Note that there are some explanatory texts on larger screens.

plurals
  1. POsimple_html_dom: Call to a member function find() on a non-object in
    primarykey
    data
    text
    <p>This code has been working good for months. The output consisted of a few lines containing statistics for a given username. The website from which the html page is taken is not down, and the content of the page in <code>file_get_html</code> hasn't changed. All of a sudden (I checked and nobody modified it) it stopped working. Here's the relevant part:</p> <pre><code>[...]if ($FileAge &gt; ($expiretime * 60) || 0 == filesize($cachename)) { include_once('simple_html_dom.php'); $html = file_get_html('http://www.foo.com/search?what=user%3A'.YOUR_USER.'&amp;search=Search'); var_dump($html); //TEST $link = $html-&gt;find('.likeh4 lightGrey.', 0)-&gt;find('a', 0)-&gt;href; // Get the last activity link [...] </code></pre> <p>The error log says:</p> <pre><code>[02-Feb-2013 17:02:19 Europe/Berlin] PHP Fatal error: Call to a member function find() on a non-object in /foo.php on line 22 (the line with $link). </code></pre> <p><code>var_dump($html)</code> gives <code>bool(false)</code> </p> <p>I have a similar script which parses an html page from another website. It stopped working as well.</p> <pre><code>[...]include_once('simple_html_dom.php'); $html = file_get_html('http://my.flightmemory.com/'.FLIGHTMEMORY_USER); $chilometri_table = $html-&gt;find('table', 2); [...] </code></pre> <p>I tried to save on my webserver one of those html pages and I don't get such error. Did my host disable some php function for security reasons? (actually, file_get_html comes from simple_html_dom and not from php native functions)</p> <p>Any hints? Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload