I'm just a beginner with programming and I'm trying to learn how to automate web procedures. I am working based on https://www.coeweb.istat.it/.
I need to find elements of the page and I already tried
with driver.find_element_by_xpath
but since I'm not very familiar with html code, I'm not even sure to be using the right piece of code as argument for that method.
Can someone please send me as an example of code to click on the link qui. in bold right in the middle of the page please?
This is what I've tried:
from selenium import webdriver
from selenium.webdriver.common.by import By
url = "https://www.coeweb.istat.it/"
driver = webdriver.Chrome()
driver.get(url)
link = driver.find_element_by_xpath('//[@id="AutoNumber1"]/tbody/tr[3]/td[2]/p[3]/font/a/strong')
link.click()
Still, I get the error as:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="AutoNumber1"]/tbody/tr[3]/td[2]/p[3]/font/a/strong"}

a[href="lnkdati.htm"]or skip clicking the button entirely and just navigate to the link withdriver.get("https://www.coeweb.istat.it/lnkdati.htm")