Selecting a specific div from a extern webpage using CURL

前端 未结 3 1349
谎友^
谎友^ 2021-02-15 07:29

Hi can anyone help me how to select a specific div from the content of a webpage.

Let\'s say i want to get the div with id=\"wrapper_content\" from webpage

3条回答
  •  南笙
    南笙 (楼主)
    2021-02-15 07:54

    include('simple_html_dom.php');
    $html = str_get_html($file_contents);
    $elem = $html->find('div[id=wrapper_content]', 0);
    

    Download simple_html_dom.php

提交回复
热议问题