I'm trying to parse a large HTML file using "PHP Simple HTML DOM Parser". The code is some thing like that:
<?php
include('/lib/simplehtmldom/simple_html_dom.php');
$data_url = "data/data.html";
$date_html = file_get_html($data_url);
foreach($date_html->find('li a') as $element){
$data = $element->href;
echo $data;
}
?>
Size of "data.html" is about 3MB. Execution of code results in "Fatal error: Call to a member function find() on a non-object in C:\xampp\htdocs\parser\index.php on line 7.
What am i suppose to do?
file_get_html()isn't returning what you think it is. Usevar_dump($date_html);to see what you're getting.