Find Element By Text With Selenium Python

October 2, 2017

Find element with extact text match.

el = driver.find_element_by_xpath("//*[text()='Exact Match']")

Fine element with partial text match.

el = driver.find_element_by_xpath("//*[contains(text(), 'Partial Match')]")
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.