I am using selenium with Python 3.7, chrome driver version 124.0.6367.91.
On the webpage for Smartplay, I am essentially trying to automate filling in the username and password.
Any suggestions for how I can input my username/password into the two fields?
I have already tried the below, but each time it results in a NoSuchElementException: Message: no such element: Unable to locate element
driver.find_element(By.NAME,"pc-login-username").send_keys(username)
driver.find_element(By.CLASS_NAME,"input").send_keys(username)
driver.find_element(By.XPATH, "/html/body/div[@id='app']/div[@class='app-router-view']/div/div[1]/div[@class='smart-play-pc-tablet']/div/div[@class='home-pc-head']/div[@class='home-pc-head-box']/div[@class='my-input el-input']/input[@class='el-input__inner']").send_keys(username)
I have even tried to wait for the element to be present, but it seems like it is never loaded on the page:
try:
myElem = WebDriverWait(driver, 10).until(EC.presence_of_element_located(By.NAME,"pc-login-username")
print ("Element is present")
except TimeoutException:
print ("Element not found")
Ductile is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.