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.
Advertisement
Answer
You cannot send anything to checkbox, you should click it . Try
passwordBox.send_keys(Keys.TAB + Keys.TAB + " ") driver.switch_to_active_element().click()