title: How do I find this div ? (PHP Simple HTML DOM Parser)
body: <p>This is my code:</p>
  
  <pre><code>&lt;?php
      include('simple_html_dom.php');
      $html = file_get_html('http://www.google.com/search?q=BA236',false);
      $title=$html-&gt;find('div#ires', 0)-&gt;innertext;
      echo $title;
  ?&gt;
  </code></pre>
  
  <p>It outputs all result of the Google Search Page under the Search "BA236".</p>
  
  <p>The problem is I dont need all of them and the Information I need is inside a div that has no id or class or anything else.</p>
  
  <p>The div I need is inside the first </p>
  
  <pre><code>&lt;div class="g"&gt;
  </code></pre>
  
  <p>on the Page, so maybe I should try something like this:</p>
  
  <pre><code>&lt;?php
      include('simple_html_dom.php');
      $html = file_get_html('http://www.google.com/search?q=BA236',false);
      $title=$html-&gt;find('div[class=g], 0')-&gt;innertext;
      echo $title;
  ?&gt;
  </code></pre>
  
  <p>But the Problem of that is, if I load the page it shows me nothing except this:</p>
  
  <blockquote>
    <p>Notice: Trying to get property of non-object in
    C:\xampp\htdocs...\simpletest2.php on line 4</p>
  </blockquote>
  
  <p>So how can i get the div i´m searching for and what am I doing wrong ?</p>
  
  <p><strong>Edit:</strong></p>
  
  <blockquote>
    <p>Solution:</p>
  </blockquote>
  
  <pre><code>&lt;?php
      include('simple_html_dom.php');
      $html = file_get_html('http://www.google.com/search?q=BA236',false);
      $e = $html-&gt;find("div[class=g]");
      echo $e[0]-&gt;innertext;
  ?&gt;
  </code></pre>
  
  <blockquote>
    <p>Or:</p>
  </blockquote>
  
  <pre><code>&lt;?php
      include('simple_html_dom.php');
      $html = file_get_html('http://www.google.com/search?q=BA236',false);
      $title=$html-&gt;find('div[class=g]')[0]-&gt;innertext;
      echo $title;
  ?&gt;
  </code></pre>