Home > Back-end >  Unable to sendkey on a password field
Unable to sendkey on a password field

Time:09-17

Im trying to press the ENTER button, the password is filling correctly so obviously the sendkeys method is working on the password field, however ENTER is not working. No exception is raised, the command is just not doing anything. What is the issue here ? Note: im attempting this on a very popular email service, do some websites just block webscraping attempts ? I managed to get through 2 pages using web-scraping to reach the password field, and then it stopped working.

password_element = browser.find_element_by_name("passwd")
password_element.send_keys("password")
password_element.send_keys(Keys.ENTER)

CodePudding user response:

password_element.send_keys("password\n")

try sending the enter as \n

CodePudding user response:

See if this helps,

from selenium.webdriver.common.keys import Keys
password_element.send_keys("password", Keys.RETURN)
  • Related