Find a specific tag with Selenium

41 views Asked by At

enter image description here

I want to be able to get id_documento with selenium. this tag is recurring in the table

enter image description here

Afer this step I want to print out a Url that has the variable document in it

I wrote this to get the tag:

Documents = driver.find_element(By.XPATH, '/html/body/div[4]/div[1]/table/tbody[4]')
Document = driver.find_element(By.CSS_SELECTOR, 'id_documento')

and this for the url

Url = 'https://download' + document + 'default'

but i get errors beacause it's not a string

1

There are 1 answers

1
Aditya Gupta On

Try to add .text at the end of document command, like this:

Document = driver.find_element(By.CSS_SELECTOR, 'id_documento').text