0

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

Zsolt Botykai
  • 50,406
  • 14
  • 85
  • 110
Abhi
  • 95
  • 1
  • 8

1 Answers1

0

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.

Community
  • 1
  • 1
Sandeep
  • 46
  • 2