0
<a href="arbitraryURL.com;Token=1" target="_top" h="ID=123,5088.1">Sign in</a>

Hey Guys,

Pretty simple question here but I'm having trouble with it for some odd reason. What is the best way to "grab" this button in selenium (using python but a generalized solution would work as well). Its a button, but its html is not a button which means this has not been working for me.

driver.find_element(By.XPATH, '//button[text()="Sign in"]')

Any help would be great, thanks!

k9b
  • 1,457
  • 4
  • 24
  • 54

1 Answers1

1

You should be able to access it using the a tag instead of button like this

driver.find_element(By.XPATH, "//a[contains(text(), 'Sign in')]")

Selenium docs on locating elements by XPath

and

A good SO answer to help locate an element that contains given text

Community
  • 1
  • 1
wpercy
  • 9,636
  • 4
  • 33
  • 45