I've written a script in python with selenium to enter a webpage and scrape some names out of it. However, when I enter the webpage, it requires the browser to do a human verification test solving captcha. I tried to tick the box next to captcha, but it doesn't seem to work at all. How can I enter the webpage and source some names in this situation?
This is what I've tried so far:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
wait = WebDriverWait(driver, 10)
driver.get(link_given_below)
try:
wait.until(EC.presence_of_element_located((By.ID, "recaptcha-anchor"))).click()
except:pass
for item in wait.until(EC.presence_of_all_elements_located((By.CSS_SELECTOR,".row .h4"))):
print(item.text)
driver.quit()
The link This_One to be used within the scraper.
Elements within the captcha embedded:
<div class="rc-anchor-content"><div class="rc-inline-block"><div class="rc-anchor-center-container"><div class="rc-anchor-center-item rc-anchor-checkbox-holder"><span class="recaptcha-checkbox goog-inline-block recaptcha-checkbox-unchecked rc-anchor-checkbox recaptcha-checkbox-hover" role="checkbox" aria-checked="false" id="recaptcha-anchor" tabindex="0" dir="ltr" aria-labelledby="recaptcha-anchor-label"><div class="recaptcha-checkbox-border" role="presentation"></div><div class="recaptcha-checkbox-borderAnimation" role="presentation"></div><div class="recaptcha-checkbox-spinner" role="presentation"></div><div class="recaptcha-checkbox-spinnerAnimation" role="presentation"></div><div class="recaptcha-checkbox-checkmark" role="presentation"></div></span></div></div></div><div class="rc-inline-block"><div class="rc-anchor-center-container"><label class="rc-anchor-center-item rc-anchor-checkbox-label" aria-hidden="true" role="presentation" id="recaptcha-anchor-label"><span aria-labelledby="recaptcha-accessible-status"></span>I'm not a robot</label></div></div></div>