Python and how to get text from Selenium element WebElement object?

Once you locate the element you can use the text property.

Example:

for element in self.driver.find_elements_by_tag_name('img'):
       print element.text
       print element.tag_name
       print element.parent
       print element.location
       print element.size

Leave a Comment