I have the following source code:
<div class = "price-text--price-part--Tu6MH udlite-clp-discount-price udlite-heading-xxl" data-purpose = "course-price-text"> <span class = "udlite-sr-only"> Current Price </span> <span> <span> 47.99 </span> </span> </div>
Now I want to get as a result: 47.99 using xpath. How Can I do that ?
driver.find_element_by_xpath('//div/span[2]/span').text
Pro tip: to find the XPath of an element on a website you can use inspect element, right click the element you want the XPath for, select copy, then copy XPath.
1.4m articles
1.4m replys
5 comments
57.0k users