How to scrape specific data from scrape with simple html dom parser

前端 未结 6 1034
北恋
北恋 2020-12-18 01:21

I am trying to scrape the datas from a webpage, but I get need to get all the data in this link.

include \'simple_html_dom.php\';
$html1 = file_get_html(\'ht         


        
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-18 02:17

    Your provided links are down, I will suggest you to use the native PHP "DOM" Extension instead of "simple html parser", it will be much faster and easier ;) I had a look at the page using googlecache, you can use something like:-

    $doc = new DOMDocument;
    @$doc->loadHTMLFile('...URL....'); // Using the @ operator to hide parse errors
    $contents = $doc->getElementById('content')->nodeValue; // Text contents of #content
    

提交回复
热议问题