About 471,000 results
Open links in new tab
  1. How to get text with Selenium WebDriver in Python

    To print the text my text you can use either of the following Locator Strategies: Using class_name and get_attribute("textContent") : print(driver.find_element(By.CLASS_NAME, "current-stage").get_attribute("textContent"))

  2. Python and how to get text from a Selenium element …

    Nov 15, 2022 · Selenium get text from an element (just add ".text"): For all elements of the list. tree = browser.find_elements_by_xpath(<the_XPATH>) for i in tree: print(i.text) [ ] fetchby number. tree = browser.find_elements_by_xpath(<the_XPATH>) print(tree[0].text)

  3. Get text content of element in Selenium - Python Examples

    In this tutorial, you will learn how to get the text content of an element, using Selenium in Python. To get the text content of an element, i.e., the visible text of an element in the webpage, in Selenium Python, locate the required element, and read the text attribute of the element object.

  4. Python Selenium: Getting Text from Elements - PyTutorial

    Oct 22, 2024 · Learn how to extract text from web elements using Python Selenium with get_attribute and text methods. Ideal for beginners in web scraping and automation.

  5. Get all text of the page using Selenium in Python

    Oct 26, 2022 · In this article, we discuss the use of Selenium Python API bindings to access the Selenium WebDrivers to click a button by text present in the button. In the following example, we take the help of Chrome.

  6. How to get text of a tag in selenium - Python? - GeeksforGeeks

    Mar 21, 2024 · In this article, we will write a Python Script for getting the text from the tag name using selenium module. Step #1: Import required libraries. Step #2: Create a Chrome object or specify web driver path if it is not present in the default path. Step #3: Specify the tag name, which you want to extract the text. Syntax: Below is the implementation.

  7. How to Get Text of an Element in Selenium: Tutorial

    Feb 7, 2023 · This guide explores how to get text of an element in Selenium using Java and Python to find web elements and how to test its cross browser compatibility.

  8. 5 Best Ways to Get Text Using Selenium WebDriver in Python

    Mar 2, 2024 · To extract text that may not be visible on the webpage (such as text in hidden elements), you can use the get_attribute() Selenium method with the ‘textContent’ DOM property. This method provides access to the textual content of an element and its descendants.

  9. Get Text with Selenium Web Driver in Python - Online Tutorials …

    Aug 28, 2020 · Learn how to retrieve text from web elements using Selenium Web Driver in Python with this comprehensive guide.

  10. python - How can I get text of an element in Selenium

    If you try to use a function like get_element_by_xpath to target the text nodes, Selenium will throw an InvalidSelectorException. One workaround is to grab the relevant HTML with Selenium and then use an HTML parsing library like Beautiful Soup that can handle text nodes more elegantly.

  11. Some results have been removed
Refresh