I'm trying to login into a page (https://www.aprovaconcursos.com.br/questoes-de-concurso/cliente/login) using selenium, chromedriver and python. But although the element is easy to find, I can't figure out a way to interact with it.
I'm running it with python 3.7, chromedriver and windows 10. Don't think this might be the problem. It seems that there is some element covering the input I'm trying to inser data into, but can't figure what.
This is the code I'm using to do it.
**def login(username, senha):
#entra no site e faz login
driver.get('https://www.aprovaconcursos.com.br/questoes-de-concurso/cliente/login')
time.sleep(30)
site_username = driver.find_element_by_id("username")
site_username.clear()
site_username.send_keys(username)
site_password = driver.find_element_by_id("password")
site_password.clear()
site_password.send_keys(senha)
driver.find_element_by_class_name("btn btn-primary").click()**
The problem is the following:
Traceback (most recent call last):
File "***.py", line 161, in <module>
login(username,senha)
File "***.py", line 125, in login
site_username.clear()
File "C:\Users\***\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 95, in clear
self._execute(Command.CLEAR_ELEMENT)
File "C:\Users\***\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "C:\Users\***\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\***\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not interactable (Session info: chrome=73.0.3683.103) (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT
10.0.17134 x86_64)
EDIT
The problem does not seem to be related with a EC. Tried the solutions provided but the condition never arises.