Python Selenium: Find Object Attributes Using Xpath
I am new to xpath, trying to get value of the 'value' using xpath: while i
Solution 1:
I finally used get_attribute("value")
as:
foriinbrowser.find_elements_by_xpath("//*[@type='submit']"):
printi.get_attribute("value")
Solution 2:
It would be like this
browser.find_elements_by_xpath("//*[@type='submit']/@value").text
Update:
With the function used by you, we can only extract the element not its attribute. To get its attribute, the expression should be something like this
browser.find_elements_by_xpath("//*[@type='submit']").get_attribute("value")
Post a Comment for "Python Selenium: Find Object Attributes Using Xpath"