accept cookies if needed
Build and Push Docker Images / build-and-push (push) Successful in 4m35s

This commit is contained in:
2025-07-29 15:23:24 +02:00
parent 4b6bfe5c1a
commit bbaa41b549
@@ -13,6 +13,19 @@ async def visit_url_service(decoded_url):
if not response: if not response:
print(f"Warning: No response object returned for {decoded_url}") print(f"Warning: No response object returned for {decoded_url}")
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:
print("No cookies to accept")
# Get page content # Get page content
content = await page.content() content = await page.content()
return {"status": "success", "content": content} return {"status": "success", "content": content}