I want to parse the HTML data from a particular url provided. But i am not able to parse data as i am getting few errors.
This is my code :-
$html = new DOMDocument();
$html->loadHTML($url); //$url is where the site url is defined
$value = array();
foreach($html->find($identifier) as $element) //$identifier is where div, a etc is stored
{
$value[] = $element->src."<br />";
}
print_r($value);
I am getting the following error
Call to undefined method DOMDocument::find()
Can anyone help me out with this .I am using cake-php 2.0
identifier?