0

I wanted to parse some informations out of a website but the above error is coming

Fatal error: Uncaught Error: Call to a member function find() on boolean in C:\xampp\htdocs\Parser\parse_berufsfotografen.php:7 Stack trace: #0 {main} thrown in C:\xampp\htdocs\Parser\parse_berufsfotografen.php on line 7

My Code is:

include_once('simple_html_dom.php');

$url = "http://www.berufsfotografen.com/reportagefotograf-eventfotograf";
$html = file_get_html($url);

foreach($html->find('a') as $element) {
    echo $element->plaintext;
    echo "<br>";
}

What am I doing wrong??

Thank you!!

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
  • 2
    This means `file_get_html()` got an error, so it returned `false`. – Barmar Jan 17 '17 at 02:07
  • Simple HTML DOM has a size limit. How big is the page you're scraping? – Barmar Jan 17 '17 at 02:08
  • 1
    The limit is 600,000 bytes. You can edit the `MAX_FILE_SIZE` constant in the script to increase it. – Barmar Jan 17 '17 at 02:09
  • Might want to read [this answer](http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php/12769983#12769983). It's a fundamental of PHP – Machavity Jan 17 '17 at 02:11

0 Answers0