About 26,300,000 results
Open links in new tab
  1. Get text from XPath located Element using Selenium

    Jun 26, 2015 · WebDriver driver; String getText = driver.findElement(By.xpath("your xpath")).getText(); This will return the text within that element.

  2. How to use XPath in Selenium? Tutorial - Guru99

    Apr 24, 2025 · The XPath text() function is a built-in function of selenium webdriver which is used to locate elements based on text of a web element. It helps to find the exact text elements and …

  3. How to Find Element by Text using Xpath Selenium: Example

    Nov 15, 2024 · Understand how to find elements by Text using Xpath Selenium for accurate test automation. Read more to learn how to perform this with an example.

  4. 5 Best Ways to Use Text in XPath in Selenium with Python

    Mar 11, 2024 · This method involves using the XPath contains() function, which matches elements that contain the specified text. It can be particularly useful when dealing with …

  5. find_element(By.XPATH) driver method - Selenium Python

    Sep 26, 2024 · How to use driver.find_element (By.XPATH) method in Selenium? Let's try to practically implement this method and get an element instance for …

  6. Complete Guide For Using XPath In Selenium With Examples

    Jun 28, 2019 · Using Text() This keyword is used to create expressions for XPath in Selenium when we have a text defined in an HTML tag and we wish to identify element via text. This …

  7. How to write and Use XPath in Selenium (Using attributes, Axes ...

    Mar 7, 2025 · In this guide, we will learn about what is XPath, how it works, and when to use it in Selenium test scripts. It is necessary to learn about different ways to find the XPath of the …

  8. How to get text, using Selenium Python XPATH - Stack Overflow

    Oct 4, 2018 · I try to find and get element (text), using. enter image description here. If I print it, I get: and I want: "The problems of a dutchman in China." You want just .text. So, use this. Start …

  9. XPath Contains: Text, Following Sibling & Ancestor in Selenium

    Apr 12, 2025 · We can extract all the elements that match the given text value using the XPath contains () function throughout the webpage. Contains in XPath has ability to find the element …

  10. XPath for input text field in Selenium - Python Examples

    To find an input text box using XPath in Selenium, you can call the find_element () method on the driver object, with By.XPATH as the strategy (parameter), and required string value (that …

  11. Some results have been removed