dealfront_enrichment.py aktualisiert
This commit is contained in:
@@ -76,7 +76,7 @@ class DealfrontScraper:
|
|||||||
# 1) Kurz Implicit-Wait absenken
|
# 1) Kurz Implicit-Wait absenken
|
||||||
self.driver.implicitly_wait(1)
|
self.driver.implicitly_wait(1)
|
||||||
|
|
||||||
# 2) Auf erstes Firmen-Element warten und Puffer
|
# 2) Auf erstes Daten-Element warten und Puffer
|
||||||
first = (By.CSS_SELECTOR, ".sticky-column a.t-highlight-text")
|
first = (By.CSS_SELECTOR, ".sticky-column a.t-highlight-text")
|
||||||
self.wait.until(EC.visibility_of_element_located(first))
|
self.wait.until(EC.visibility_of_element_located(first))
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
@@ -91,7 +91,7 @@ class DealfrontScraper:
|
|||||||
rows = self.driver.find_elements(*rows_sel)
|
rows = self.driver.find_elements(*rows_sel)
|
||||||
logger.info(f"{len(rows)} Firmen-Zeilen gefunden.")
|
logger.info(f"{len(rows)} Firmen-Zeilen gefunden.")
|
||||||
|
|
||||||
# 4) Ohne weitere Sleeps/Implicit-Waits extrahieren
|
# 4) Schleife ohne weitere Sleeps
|
||||||
for i, row in enumerate(rows, 1):
|
for i, row in enumerate(rows, 1):
|
||||||
name_elems = row.find_elements(By.CSS_SELECTOR, ".sticky-column a.t-highlight-text")
|
name_elems = row.find_elements(By.CSS_SELECTOR, ".sticky-column a.t-highlight-text")
|
||||||
if not name_elems:
|
if not name_elems:
|
||||||
@@ -114,7 +114,7 @@ class DealfrontScraper:
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
# 5) Implicit-Wait wieder auf Standard setzen
|
# 5) Implicit-Wait wieder auf Standard setzen (z.B. 10 s)
|
||||||
self.driver.implicitly_wait(10)
|
self.driver.implicitly_wait(10)
|
||||||
|
|
||||||
def click_next_page(self):
|
def click_next_page(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user