How do I find an element that contains specific text in Selenium WebDriver?

How do I find an element that contains specific text in Selenium WebDriver?

It’s easy to find an element containing specific text with Selenium Python webdriver with the help of xpath. The locator consists of functioning helping you to verify a particular text within any element. The xpath function text() can be utilised to identify any webelement that depends on the visibility of the text.