Skip to content

Commit

Permalink
Accept cookies for Google before searching (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoseangel authored Jan 18, 2025
1 parent 6e4af30 commit 0a7fb69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fake_traffic/fake_traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ async def acrawl(self):
search_urls = []
try:
await page.goto("https://www.google.com", wait_until="load")
accept_all = await page.is_visible("#L2AGLb")
if accept_all:
await page.click("#L2AGLb")
await page.fill('textarea[name="q"]', keyword)
await page.press('textarea[name="q"]', "Enter")
# pagination
Expand Down

0 comments on commit 0a7fb69

Please sign in to comment.