Funktion Clear checkboxes updated
Löscht nun auch den text aus dem search_input feld.
This commit is contained in:
parent
8b82bb8975
commit
85c662b048
@ -304,9 +304,6 @@ class SearchThread(QThread):
|
||||
# Webseite aufrufen
|
||||
self.driver.get(search_url)
|
||||
|
||||
cookie_button = self.driver.find_element(By.CLASS_NAME, "nw_button__label")
|
||||
cookie_button.click()
|
||||
|
||||
def suche_auf_knauss(self):
|
||||
# URL für die Suche generieren
|
||||
search_url = f'https://knauss.info/dksearch?sSearch={self.search_term}'
|
||||
@ -360,9 +357,6 @@ class SearchThread(QThread):
|
||||
# Webseite aufrufen
|
||||
self.driver.get(search_url)
|
||||
|
||||
cookie_button = self.driver.find_element(By.ID, "ppms_cm_reject-all")
|
||||
cookie_button.click()
|
||||
|
||||
def suche_auf_lusini(self):
|
||||
|
||||
# URL für die Suche generieren
|
||||
@ -454,14 +448,17 @@ class SearchThread(QThread):
|
||||
search_box.send_keys(self.search_term)
|
||||
search_box.send_keys(Keys.RETURN)
|
||||
|
||||
WebDriverWait(self.driver, 20).until(EC.presence_of_element_located((By.CLASS_NAME, "popuptype.fancybox-content")))
|
||||
kunde = self.driver.find_element(By.CLASS_NAME, "popuptype_knap_erhverv.moms_off")
|
||||
kunde.click()
|
||||
|
||||
def suche_auf_franzmensch(self):
|
||||
# URL für die Suche generieren
|
||||
search_url = f'https://www.franz-mensch.de/search?search={self.search_term}'
|
||||
|
||||
# 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.ID, "search")))
|
||||
|
||||
|
||||
def suche_auf_frankflechtwaren(self):
|
||||
# URL für die Suche generieren
|
||||
search_url = f'https://www.frank-flechtwaren.de/suchergebnisse/?query={self.search_term}'
|
||||
@ -924,13 +921,13 @@ class WebseitenSucheApp(QWidget):
|
||||
layout.addLayout(grid_layout)
|
||||
|
||||
# Suchbegriff-Eingabe
|
||||
search_label = QLabel("Geben Sie den Suchbegriff ein:")
|
||||
layout.addWidget(search_label)
|
||||
self.search_label = QLabel("Geben Sie den Suchbegriff ein:")
|
||||
layout.addWidget(self.search_label)
|
||||
|
||||
search_input = QLineEdit(self)
|
||||
search_input.textChanged.connect(self.update_search_term)
|
||||
layout.addWidget(search_input)
|
||||
search_input.setStyleSheet("color: white; border: 1px solid white;")
|
||||
self.search_input = QLineEdit(self)
|
||||
self.search_input.textChanged.connect(self.update_search_term)
|
||||
layout.addWidget(self.search_input)
|
||||
self.search_input.setStyleSheet("color: white; border: 1px solid white;")
|
||||
|
||||
# Suchen-Button
|
||||
search_button = QPushButton("Suche starten", self)
|
||||
@ -966,6 +963,7 @@ class WebseitenSucheApp(QWidget):
|
||||
def clear_checkboxes(self):
|
||||
for webpage in self.checkbox_states:
|
||||
self.update_webpage_state(webpage, False)
|
||||
self.search_input.clear()
|
||||
|
||||
def update_search_term(self, text):
|
||||
self.search_term = text
|
||||
@ -991,6 +989,10 @@ class WebseitenSucheApp(QWidget):
|
||||
self.search_thread.wait()
|
||||
if hasattr(self.search_thread, 'error_message') and self.search_thread.error_message:
|
||||
QMessageBox.critical(None, "Fehler", self.search_thread.error_message)
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
if event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return:
|
||||
self.start_search()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user