1

enter image description here

I am trying to click on the link shown on the attachment but, no matter what I try, webdriver can't find the element. I tried these:

elem = driver.find_element_by_xpath("/html/body/div[1]/div/div/div[2]/div[2]/div/div[1]/div/div[1]/div/div[1]/div[2]/div/div/table/tbody/tr/td[1]/div/a").click()

elem = driver.find_element_by_xpath("//*[text()='P0005 - ORP TEST Dev Team 4 Mateusz']").click()

elem = driver.find_element_by_link_text("P0005 - ORP TEST Dev Team 4 Mateusz").click()
6
  • 1
    What is the exact error? Do you wait for the element/page to load? Your selectors look ok. Sep 10 '20 at 7:44
  • selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"link text","selector":"P0005 - ORP TEST Dev Team 4 Mateusz"} (Session info: chrome=85.0.4183.83)
    – mat
    Sep 10 '20 at 7:51
  • Try to wait for element to be clickable: selenium-python.readthedocs.io/waits.html Sep 10 '20 at 8:48
  • i tried waits, i even put a simple time.sleep from python but it still cant find it
    – mat
    Sep 10 '20 at 8:57
  • 1
    it worked! didnt realise i need to switch to iframe. thank you a lot!
    – mat
    Sep 10 '20 at 9:20
0

There are some steps in debuging NoSuchElementException:

For more debugging steps and ideas read: How to analyse 'Element not Found' exceptions when working with Selenium

Not the answer you're looking for? Browse other questions tagged or ask your own question.