douhe6255 2019-05-24 08:43
浏览 86

XPath选择器在chrome dev工具上工作,但没有php domXpath,为什么呢

Trying to scrape a page using xpath and php domxpath, the xpath expression is pulling data in chrome dev tool, but it returns empty result on php code, Here is the sample page

    $dom = new DOMDocument();
    @$dom->loadHTMLFile($file);
    $xpath = new DOMXPath($dom);    

    $nodes = $xpath->query('//*[@id="detail_bullets_id"]/table/tbody/tr/td/div/ul/li');

I tried saving entire file as html file and did xpath query on that. Can someone help ? Thanks.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 彩灯控制电路,会的加我QQ1482956179
    • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
    • ¥15 (关键词-电路设计)
    • ¥15 如何解决MIPS计算是否溢出
    • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
    • ¥15 操作系统相关算法中while();的含义
    • ¥15 CNVcaller安装后无法找到文件
    • ¥15 visual studio2022中文乱码无法解决
    • ¥15 关于华为5g模块mh5000-31接线问题
    • ¥15 keil L6007U报错