This commit is contained in:
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user