1

basically I would like to select the link underlined whose html is provided in the picture and navigate inside it to get info

How can I do it?

Thank you

1 Answer 1

1

Try that

import selenium
driver = selenium.webdriver.Firefox()
URL = 'url'
driver.get(URL)
a = driver.find_elements_by_css_selector("a.profile-link")
href = a.get_attribute("href")
print(href)

after click

li_obcject = driver.find_elements_by_id('who-atc-codes')
lst = li_object.find_element_by_tag_name("span").find_elements_by_tag_name("p")

for el in lst:
    print(el.text)
Sign up to request clarification or add additional context in comments.

1 Comment

thank you. It works perfectly. Thee very last thing I would like to do after clicking with a[0].click() is to get elements inside of them. But maybe I should answer since this is a new question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.