Selenium “Please verify you are a human” Popup in Firefox

Submitted 3 years, 7 months ago
Ticket #133
Views 867
Language/Framework Other
Priority Low
Status Closed

'm curious if anyone has found a work around for handling the random "Please Verify you are human" pop up in FireFox when using Selenium and BeautifulSoup. Currently, it pops up about every 500 or 1,000 URL requests, but I'd love an automated workaround.

My driver is just the default driver = webdriver.Firefox() with selenium. The pop up is a press AND hold button (picture below) which I've just done manually as I've seen it pop up. Any info would be great thanks!

enter image description here

Submitted on Sep 10, 20
add a comment

1 Answer

Verified

For each URL in the list that is being scraped I do a time.sleep(5.5) to allow URL to fully load or for the verify popup to occur. Then, I interact with the URL and look for the verify indicator. For StockX it works like this: while true, try soup.find('div', class_='page-title').text and if it finds '\nPlease verify you are a human\n' then close browser and sleep (driver.quit() and time.sleep(20)) else scrape elements.

for url in url_list:
  for attempt in range(5):
    try:
      if soup.find('div', class_='page-title').text == '\nPlease verify you are a human\n':
        driver.quit()
        time.sleep(20)
      else:
        scrape_everything()
    except:
      print(f'Hit Verify Page Attempt Num.: {attempt}')
    else:
      break
  else:
    continue

Submitted 3 years, 6 months ago


Latest Blogs