click an input, selenium with python

Viewed 25

I´m new to selenium and i´m trying that selenium click a button and send keys. I've tried with id, class name, xpath and i haven't been able to do it. Here is the code.

website = "https://weather.com/?Goto=Redirected"

path = "C:/Users/Administrador/Downloads/chromedriver_win32/chromedriver.exe"

driver = webdriver.Chrome(service=Service(path))

driver.get(website)

button = driver.find_element(By.XPATH, '//*[@id="LocationSearch_input"]')

button.clear()

button.send_keys("medellin")

button.send_keys(Keys.RETURN)

time.sleep(3)

and this is the error that i get:

Message: invalid element state: Element is not currently interactable and may not be manipulated
  (Session info: chrome=105.0.5195.127)
1 Answers

I had the same problem and i found how to ask Selenium to click a button:

driver.find_element_by_id('XXX').click()

Try this

Related