Skip to content
Advertisement

How to extract price from given url using Xpath?

From a given url I want to extract some detail from it like title, price.

For the title, it works fine with this code:

JavaScript

But I wonder how to extract price($) using xpath? Is there any way to solve this?

Advertisement

Answer

JavaScript

This will find <p class="price right s-cf">US$160000</p>

The contains is doing a wildcard search on the class attribute of the element.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement