I'm having an issue using Selenium on Python. Here is the whole error code :
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div/div[3]/div[2]/form[1]/input"}
(Session info: MicrosoftEdge=89.0.774.57)
and here is the element I'm trying to access :
The fact is that when I click on that element and copy the full XPath, here is what I have :
/html/body/div/div[3]/div[2]/form[1]/input
but it doesn't work for some reasons... I tried almost everything : with the name, with the value, with the normal XPath (which is //*[@id="content"]/form[1]/input
by the way)
I'm using Edge Chromium and I use Python 3.9.0 and here is the code I'm using (everything work perfectly until the variable telechargerReleve
:
from selenium import webdriver
driver = webdriver.Edge(executable_path="automation_drivers/msedgedriver.exe")
driver.get("https://login.unice.fr/login?service=https://ent.unice.fr/uPortal/Login")
usernameElement = driver.find_element_by_id("username")
passwordElement = driver.find_element_by_id("password")
usernameElement.send_keys("myUsername")
passwordElement.send_keys("myPassword")
login = driver.find_element_by_name("submit")
login.click()
mesInfos = driver.find_element_by_xpath("/html/body/table[2]/tbody/tr/td[3]/table/tbody/tr[2]/td[3]/a")
mesInfos.click()
intracursus = driver.find_element_by_xpath("/html/body/table[3]/tbody/tr/td[2]/span[2]/a[3]")
intracursus.click()
telechargerReleve = driver.find_element_by_xpath("/html/body/div/div[3]/div[2]/form[1]/input")
telechargerReleve.click()
Thank you in advance, Roux.
PS : Some texts may be in French so if you need a traduction or something, feel free to ask me!