Python Selenium Can t enter a webpage using my script

0 votes

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>

Jul 31, 2018 in Selenium by Martin
• 4,320 points
2,390 views

1 answer to this question.

0 votes
CAPTCHA is used to stop website automation & that's why it cannot be automated using selenium. Adn for same reason, your not able to select CAPTCHA tick box.
answered Jul 31, 2018 by Samarpit
• 5,910 points

Related Questions In Selenium

+1 vote
2 answers

Is it possible to scroll down in a webpage using selenium webdriver programmed on python?

I using next code for facebook for ...READ MORE

answered May 16, 2019 in Selenium by mslavikas@gmail.com
26,069 views
0 votes
1 answer

Automation script for handling Calendar on a webpage using Selenium Webdriver?

Hi Shruti, here's the automation script for ...READ MORE

answered Jun 4, 2019 in Selenium by Abha
• 28,140 points
2,746 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8, 2019 in Selenium by Anvi
• 14,150 points
15,828 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,649 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,131 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,209 views
0 votes
1 answer

How to login a forum using Selenium with Python

You should try to directly log in ...READ MORE

answered Apr 27, 2018 in Selenium by Samarpit
• 5,910 points
2,751 views
+1 vote
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP