0
from selenium.webdriver.common.keys import Keys

# ...
browser = webdriver.Chrome()

passwordBox = browser.find_element_by_css_selector('input[id="account_password"]')

passwordBox.send_keys(password)

passwordBox.send_keys(Keys.TAB + Keys.TAB + " ")

As I, among others, were having trouble simulating a click on the ReCaptcha v2 checkbox, one user found away to check it with Selenium's Keys. That method is not working for me.

It traverses to the checkbox, but it just remains highlighted. It's not a space that isn't able to be sent at that point, but any key.

2
  • What's the website? Commented Jan 14, 2021 at 3:14
  • 1
    you cannot send anything to check box , you should click it ? Commented Jan 14, 2021 at 5:02

1 Answer 1

2

You cannot send anything to checkbox, you should click it . Try

passwordBox.send_keys(Keys.TAB + Keys.TAB + " ")
driver.switch_to_active_element().click()
Sign up to request clarification or add additional context in comments.

2 Comments

You're a lifesaver who will continue to do great things
in case the selenium has that method deprecated stackoverflow.com/a/41315273/13642249

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.