How do I find an element that contains specific text in Selenium WebDriver (Python)? September 25, 2022 by Tarik Try the following: driver.find_elements_by_xpath("//*[contains(text(), 'My Button')]")