title: simple html dom grabbing h1 header
body: <p>I just learning about simple_html_dom.php,
  I try to get the h1 content with some class.</p>
  
  <pre><code>&lt;h1 class="entry-title"&gt;example for the header&lt;/h1&gt;
  </code></pre>
  
  <p>here the raw html file from the website that i want to get the content.</p>
  
  <pre><code>    &lt;header class="entry-header"&gt;
      &lt;div class="entry-meta"&gt;
          &lt;span class="cat-links"&gt;&lt;a href="https://xxxxx/2016/08/11/xxxxxxx" rel="category tag"&gt;News&lt;/a&gt;&lt;/span&gt;
      &lt;/div&gt;
      &lt;h1 class="entry-title"&gt;example for the header&lt;/h1&gt;
      &lt;div class="entry-meta"&gt;
          &lt;span class="entry-date"&gt;&lt;a href="https://xxxxx/2016/08/11/xxxxxxx" rel="bookmark"&gt;&lt;time class="entry-date" datetime="2016-08-11T11:54:07+00:00"&gt;11 August 2016&lt;/time&gt;&lt;/a&gt;&lt;/span&gt; 
          &lt;span class="byline"&gt;&lt;span class="author vcard"&gt;&lt;a class="url fn n" href="https://xxxxx/2016/08/11/xxxxxxx" rel="author"&gt;wndwnrt&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;          
          &lt;span class="comments-link"&gt;&lt;a href="https://xxxxx/2016/08/11/xxxxxxx"&gt;1 Comment&lt;/a&gt;&lt;/span&gt;
      &lt;/div&gt;
  &lt;/header&gt;
  </code></pre>
  
  <p>here my code to get the h1 class="entry-title" content (example for the header)</p>
  
  <pre><code>&lt;?php
   require_once __DIR__.'/simple_html_dom.php';
   $html = new simple_html_dom();
   $html-&gt;load_file('https://xxxxx/2016/08/11/xxxxxxx');
   $header_1 = $html-&gt;find('h1[class="entry-title"]')-&gt;innertext;
  ?&gt;
  &lt;table border="1"&gt;
   &lt;thead&gt;
     &lt;tr&gt;
       &lt;th&gt;&lt;?php echo $header_1; ?&gt;&lt;/th&gt;
    &lt;/tr&gt;
   &lt;/thead&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>when i run the code, the result is error:</p>
  
  <pre><code>Trying to get property of non-object
  </code></pre>
  
  <p>can anyone tell where is the error? and what i should to do?
  Thank you very much.</p>