Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从这个亚马逊网站提取 Kindle 书籍的销售排名。
在上述情况下,销售排名为 3(元素名称“ SalesRank”)
SalesRank
这是我到目前为止所尝试的
$xpath_kindle->query("//li[@id='SalesRank']")->item(0)->nodeValue;
任何帮助是极大的赞赏
使用 this xpath://li[@id='SalesRank']/text()并使用正则表达式来选择排名数字。另请查看 SO 中的这个问题,其中提到了一些非常好的工具。
//li[@id='SalesRank']/text()