Answers for "locate element using text"

1

selenium find element by content

driver.find_elements_by_xpath("//*[contains(text(), 'My Button')]")
Posted by: Guest on September-21-2020
0

locate element using text

The only locator that works with text is xpath. 
Matching exact text		:    //tag[.=‘text’]
Matching partial text		:    //tag[contains(text(), ’text’)]
Posted by: Guest on December-04-2020

Browse Popular Code Answers by Language