I am trying to extract Sales rank of kindle books from this amazon site.
In the above case the sales rank is 3 (element name "SalesRank
")
This is what i have tried till now
$xpath_kindle->query("//li[@id='SalesRank']")->item(0)->nodeValue;
any help is greatly appreciated
Use the this xpath:
//li[@id='SalesRank']/text()
and use regex to select the rank numeral. Also look at this question in SO where some really good tools are mentioned.