i hate this application
Build and Push Docker Images / build-and-push (push) Successful in 22s

This commit is contained in:
2025-07-29 15:41:50 +02:00
parent bbaa41b549
commit 3a46fe2d17
+16 -10
View File
@@ -13,17 +13,23 @@ async def visit_url_service(decoded_url):
if not response:
print(f"Warning: No response object returned for {decoded_url}")
cookie_buttons = [
'Accept all',
'Accepteer',
'Accepteren',
'Accept'
]
try:
# if page has text "Accept all" or "Accepteer" or "Accept" click it
if await page.evaluate('''() => {
return document.querySelector('text=Accept all') ||
document.querySelector('text=Accepteer') ||
document.querySelector('text=Accept');
}'''):
await page.click('text=Accept all')
await page.click('text=Accepteer')
await page.click('text=Accept')
except:
for button in cookie_buttons:
element = await page.query_selector(f'text="{button}"')
if element:
await element.click()
print(f"{button} button found and clicked")
break
except Exception as e:
print(f"Error during cookie acceptance: {e}")
print("No cookies to accept")
# Get page content