Untitled

mail@pastecode.io avatar
unknown
python
3 years ago
666 B
3
Indexable
Never
import time
from selenium import webdriver

browser = webdriver.Chrome("C:\Python\GPU bot\chromedriver_win32")
browser.get("https://www.notebooksbilliger.de/nvidia+geforce+rtx+3080+founders+edition+683301")

buyButton = False

while buyButton == False:
    try:
        addtooCartButton = addButton = browser.find_element_by_class_name("soldOut")
        print("Ausverkauft")
        time.sleep(1)
        browser.refresh()
    except:
        addtooCartButton = addButton = browser.find_element_by_class_name("js-pdp-head-add-to-cart")
        print("Verfügbar")
        addtooCartButton.click()
        print("Zum Warenkorb hinzugefügt")
        buyButton = True