Issue
I am trying to get the tag text content on an HTML page by using Selenium methods, but it seems method someElement.getText()
is not available in Python.
Is there a way?
Here's a traceback:
AttributeError: 'WebElement' object has no attribute 'getText'
Solution
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
Answered By - aberna
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.