I finally used get_attribute("value") as:
for i in browser.find_elements_by_xpath("//*[@type='submit']"):
print i.get_attribute("value")
Answer from root on Stack OverflowPython Selenium: Find object attributes using xpath - Stack Overflow
Using xpath to find element does not always work
[selenium] How to find span in found element in selenium python
Help with Selenium XPATH
Videos
I finally used get_attribute("value") as:
for i in browser.find_elements_by_xpath("//*[@type='submit']"):
print i.get_attribute("value")
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")
Ref: http://selenium-python.readthedocs.org/en/latest/api.html#selenium.webdriver.remote.webelement.WebElement.find_elements_by_tag_name
I am using python 3.7 in jupyter notebook. It works just as it should until it doesn't. It says that it cannot find the element and then it never can find it again. I have restarted kernel and that did not solve it. I am just using xpaths from the homepage of pyhton.org.
edit:
To get the xpath I am coping it from the inspect element in chrome. When I compare the error xpath and the one from the webpage they are an exact match.