m1k3y3
m1k3y3

Reputation: 2788

php simple html dom parser how to get the content of html tag

I am trying to get the specific tag content, but seems I am not able to do so using following function

<?PHP
include_once('simple_html_dom.php');

function read_page($url = 'http://google.com')
{
        $doc = new DOMDocument();

        $data = file_get_html($url);

        $content = $data->find('div#footer');

        print_r( $content);

}

read_page();
?>

Upvotes: 1

Views: 2953

Answers (1)

slash197
slash197

Reputation: 9034

Try $data->find('div[id="footer"]')

Upvotes: 2

Related Questions