Neue Funktion

neue cookie akzeptieren knopf in den Such funktionen
Gastroteileshop
TiroLED
Megabad
This commit is contained in:
Domenik Rath 2023-12-01 18:50:08 +01:00
parent 717fe33100
commit bbb0ecbe83

View File

@ -240,7 +240,7 @@ class SearchThread(QThread):
# Webseite aufrufen und auf das vollständige Laden warten
self.driver.get(search_url)
WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.NAME, "global_search")))
WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.NAME, "global_search")))
def suche_auf_gastroteileshop(self):
@ -253,6 +253,9 @@ class SearchThread(QThread):
# Warten, bis das Suchfeld sichtbar ist
WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.CLASS_NAME, "search-input")))
cookie_button = self.driver.find_element(By.CLASS_NAME, "btn.btn-primary.btn-block.btn-appearance")
cookie_button.click()
# Suchbegriff eingeben und Suche starten
search_box = self.driver.find_element(By.CLASS_NAME, "search-input")
search_box.clear() # Falls vorheriger Text vorhanden ist
@ -267,6 +270,9 @@ class SearchThread(QThread):
self.driver.get(search_url)
WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.NAME, "search")))
cookie_button = self.driver.find_element(By.CLASS_NAME, "cookie-consent-accept-only-functional-button.btn.btn-primary.cookie-consent-button-margin")
cookie_button.click()
def suche_auf_megabad(self):
# URL für die Suche generieren
search_url = f'https://www.megabad.com/search/?query=sdyc/#/q/{self.search_term}'
@ -275,6 +281,9 @@ class SearchThread(QThread):
self.driver.get(search_url)
WebDriverWait(self.driver, 10).until(EC.presence_of_element_located((By.ID, "search-bar-input")))
cookie_button = self.driver.find_element(By.CSS_SELECTOR, ".cmpboxbtn.cmpboxbtnyes.cmptxt_btn_yes")
cookie_button.click()
def suche_auf_baubeschlag(self):
# URL für die Suche generieren
search_url = f'https://www.baubeschlagshop.de/fts.php?criteria={self.search_term}'