Sometimes, we want to get text with Selenium WebDriver in Python.
In this article, we’ll look at how to get text with Selenium WebDriver in Python.
How to get text with Selenium WebDriver in Python?
To get text with Selenium WebDriver in Python, we use the element’s text
property.
For instance, we write
driver.find_element_by_class_name("ctsymbol").text
to call find_element_by_class_name
to get the first element with class ctsymbol
.
And then we use the text
property of it to get the text of the element returned.
Conclusion
To get text with Selenium WebDriver in Python, we use the element’s text
property.