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
|
||||
if "consent.google" in sb.get_current_url() or "Bevor Sie" in sb.get_title():
|
||||
for selector in [
|
||||
'form[action*="save"] button',
|
||||
'button[aria-label*="Alle akzeptieren"]',
|
||||
'button[aria-label*="Accept all"]',
|
||||
'form[action*="save"] button',
|
||||
'button.tHlp8d',
|
||||
'div#introAgreeButton',
|
||||
'button:contains("Alle akzeptieren")',
|
||||
]:
|
||||
try:
|
||||
sb.click(selector, timeout=3)
|
||||
|
|
@ -78,6 +77,9 @@ def scrape_google_flights(von, nach, tage=30):
|
|||
break
|
||||
except Exception:
|
||||
continue
|
||||
# Nach Consent nochmal zur Such-URL navigieren
|
||||
sb.open(url)
|
||||
sb.sleep(6)
|
||||
|
||||
# Cookie-Banner auf der Flights-Seite
|
||||
for selector in ['button[aria-label*="Alle"]', 'button[aria-label*="Accept"]',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue