selenium contains component code example
Example 1: selenium find element by content
driver.find_elements_by_xpath("//*[contains(text(), 'My Button')]")
Example 2: xpath contains text
//button[contains(text(),"Go")]
driver.find_elements_by_xpath("//*[contains(text(), 'My Button')]")
//button[contains(text(),"Go")]