-1
I’m making a bot that goes through a page until it reaches where you download a file, but I can’t access a link using the driver.find_element_by_xpath
, because the page link is as href
and does not have a class for which I identify. Below is my code:
<a href="https://www.excelcontabilidade.com.br/tabela-de-correcao-monetaria/indicadores"><a/>
My code in Python:
WebDriverWait(driver,5).until(EC.visibility_of_element_located((By.XPATH,"""//*[@]]""")))
driver.find_element_by_xpath("""//[*href="https://www.excelcontabilidade.com.br/tabela-de-correcao-monetaria/indicadores""]""").click()
Can anyone tell me how to access the hyper-link without a class, id
or name
defined?
This XPATH seems to be wrong. To get the right XPATH, open the page, right click and click on "inspect element" or something like that. Inside the 'inspect element', select this part of the code where you have the element that you want to pick up, right-click and select "Copy -> xpath"
– Vinicius Bussola