simple html dom find gives error Trying to get property of non-object
<p>i am using simple_html_dom to get a text from a website but it gives me</p>

<pre><code>Notice: Trying to get property of non-object in C:\wamp64\www\fetch.php on line 6
</code></pre>

<p>the website has this.</p>

<pre><code>&lt;div&gt;
 &lt;div class="info"&gt;number: (IUL)306/306/2016/68&lt;/div&gt;
 &lt;div class="info"&gt;published date: 14 june 2016&lt;/div&gt;
 &lt;div class="info"&gt;published time: 1442&lt;/div&gt;
 &lt;div class="info"&gt;expiry time 23 june 2016 1100&lt;/div&gt;
&lt;div&gt;
</code></pre>

<p>my php looks like this which i am trying to get the second div with class info.</p>

<pre><code>&lt;php?include_once('simple_html_dom.php');
$html = file_get_html('http://www.example.com');
$html-&gt;save();

foreach($html-&gt;find('div[class=info]', 2) as $e)
        $pdate = $e-&gt;innertext . '&lt;br&gt;';

 echo "pdate: $pdate";
 ?&gt;
</code></pre>

<p>any  possible solutions to achieve this?</p>