Skip to main content
3 of 3
replaced http://stackoverflow.com/ with https://stackoverflow.com/

Try either:

driver.find_element_by_xpath(u'//a[text()="Foo text"]')

or dedicated driver method:

driver.find_element_by_link_text("Foo text")

Add .click() if needed.

For troubleshooting, check this post at SO, as maybe your page isn't loaded yet, so you probably need to write a wait wrapper to wait for an element to appear.

kenorb
  • 377
  • 1
  • 3
  • 15