0
I’m using the python Selenium Webdriver to log in to a site to do some tasks, I’m able to click login, but it doesn’t take the input I ask to type.
This is code Selenium:
import time
import requests
import pandas as pd
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSoup
driver = webdriver.Chrome(executable_path=r'./chromedriver.exe')
url = "https://gool.cittati.com.br/Login.aspx?ReturnUrl=%2f"
driver.get(url)
driver.implicitly_wait(20)
login = driver.find_element_by_xpath("//div[@class='listaIcones']//ul//li//input[@id='ucTrocarModulo_btnIconeUrbano']")
login.click()
usarname = driver.find_element_by_xpath("//div[@class='form']//div[@id='ucLogarUsuario_divCampos']//div[@id='ucLogarUsuario_pnlLogin']//div[@class='user']//input[@id='ucLogarUsuario_txtLogin']").send_keys("username")
#password = driver.find_element_by_xpath("//div[@class='form']//div[@id='ucLogarUsuario_divCampos']//div[@id='ucLogarUsuario_pnlSenha']").send_keys("password")
driver.quit()
And this is the html code I’m trying to access:
<div class="form">
<div id="ucLogarUsuario_divCampos" class="campos" onkeydown="return logar(event);">
<div id="ucLogarUsuario_pnlLogin">
<label>
Login</label>
<div class="user">
<input name="ucLogarUsuario$txtLogin" type="text" maxlength="100" id="ucLogarUsuario_txtLogin" tabindex="1" />
</div>
</div>
<div id="ucLogarUsuario_pnlSenha">
<label>
Senha</label>
<div class="user">
<input name="ucLogarUsuario$txtSenha" type="password" maxlength="15" id="ucLogarUsuario_txtSenha" tabindex="2" class="userFocus" value="" />
</div>
</div>
When I run the code Selenium shows the following message: Elementnotinteractableexception: Message: element not interactable
Does anyone know what’s going on ?
may be that the element is not yet available, try to get a Wait for a few seconds
– Ricardo Pontual
Did you notice if while trying to fill these fields, they are visible on the screen so that you yourself without automation could type in them, or if they were behind a div or something similar?
– phduarte