Skip to content
Advertisement

Selenium webdriver : find element question

I am trying to use python Selenium for the first time.
This would be a simple question for some of you but I am a bit disappointed here..

I would click on a link text which will open another webpage (WebDriver IE)

When I inspect the link I have this:

JavaScript

I tried this :

JavaScript

but this will open another link in my page
inspection of the link opened below

JavaScript

My question is how to get the right element to open the right page? I have to use Internet explorer as the application won’t work with other browser.

Thanks in advance

Advertisement

Answer

Try to use one of the following locators:

JavaScript

Or

JavaScript

find_element_by_link_text is not always a good idea because there may be many same locators.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement