how to search for an element with specific text in selenium code example
Example 1: selenium find element by content
driver.find_elements_by_xpath("//*[contains(text(), 'My Button')]")
Example 2: Select by visible text in Selenium contains
driver.findElements(By.xpath("//select[@id = 'selectId')]/option[contains(text(), 'DOLLAR')]")).click();