fix: nach Consent-Accept nochmal zur Such-URL navigieren
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
7cd39d0387
commit
9ad786e171
1 changed files with 4 additions and 2 deletions
|
|
@ -65,12 +65,11 @@ def scrape_google_flights(von, nach, tage=30):
|
||||||
# Google Consent-Seite (DSGVO, DE-IPs) wegklicken
|
# Google Consent-Seite (DSGVO, DE-IPs) wegklicken
|
||||||
if "consent.google" in sb.get_current_url() or "Bevor Sie" in sb.get_title():
|
if "consent.google" in sb.get_current_url() or "Bevor Sie" in sb.get_title():
|
||||||
for selector in [
|
for selector in [
|
||||||
|
'form[action*="save"] button',
|
||||||
'button[aria-label*="Alle akzeptieren"]',
|
'button[aria-label*="Alle akzeptieren"]',
|
||||||
'button[aria-label*="Accept all"]',
|
'button[aria-label*="Accept all"]',
|
||||||
'form[action*="save"] button',
|
|
||||||
'button.tHlp8d',
|
'button.tHlp8d',
|
||||||
'div#introAgreeButton',
|
'div#introAgreeButton',
|
||||||
'button:contains("Alle akzeptieren")',
|
|
||||||
]:
|
]:
|
||||||
try:
|
try:
|
||||||
sb.click(selector, timeout=3)
|
sb.click(selector, timeout=3)
|
||||||
|
|
@ -78,6 +77,9 @@ def scrape_google_flights(von, nach, tage=30):
|
||||||
break
|
break
|
||||||
except Exception:
|
except Exception:
|
||||||
continue
|
continue
|
||||||
|
# Nach Consent nochmal zur Such-URL navigieren
|
||||||
|
sb.open(url)
|
||||||
|
sb.sleep(6)
|
||||||
|
|
||||||
# Cookie-Banner auf der Flights-Seite
|
# Cookie-Banner auf der Flights-Seite
|
||||||
for selector in ['button[aria-label*="Alle"]', 'button[aria-label*="Accept"]',
|
for selector in ['button[aria-label*="Alle"]', 'button[aria-label*="Accept"]',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue