How can I extract the value from a html file in this form using selenium:
<body>
<div class="some stuff">
<span class="some other stuff">the number wanted</span>
</div>
</body>
I tried using the get_attribute function on the element but that can only return the class.
Code so far
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome()
driver.get("website")
elem = driver.find_element_by_xpath('xpath to wherever')
print(elem.get_attribute("value")) #tried originally
driver.close()
Also important to note that the website must be signed in the particular website I was trying wouldnt work for most people. Thanks for any help.