I am trying to use python, selenium and xpath to grab the text $0.180 in the following block of HTML,
<div class="wlp-values-div">
<span class="wlp-last-price-span">$0.180</span>
This code is deep into a websites HTML and I tried to use the following Xpath to locate it:
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome()
driver.get("https://smallcaps.com.au/stocks/?symbol=AWJ")
time.sleep(3)
webdriver.ActionChains(driver).send_keys(Keys.ESCAPE).perform()
ele = driver.find_element_by_xpath("//div[@class='wlp-values-div']/span[@class='wlp-last-price-span']")
But I receive the error:
NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@class='wlp-values-div']/span[@class='wlp-last-price-span']"}
Any help would be greatly appreciated