Selecting a specific div from a extern webpage using CURL

前端 未结 3 1821
执念已碎
执念已碎 2021-02-15 07:06

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:58

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

    Download simple_html_dom.php

提交回复
热议问题