In the script below, I’m getting an error when the URL is not found or reports 404…
Fatal error: Call to a member function find() on a non-object
How can I code around it?
function processPage(){
$this->html = scrapePage($this->url);
$dom = str_get_html($this->html);
$metakws = $dom->find('meta[name=keywords]'); //ERROR OCCURS HERE WHEN URL NOT FOUND
//etc...
}
Check for
Or