title: PHP Simple DOM find not working
body: <p>This had me stuck for a while so I thought I would post it. My issue was that my find-> was not working correctly and $product_name was coming up null</p>
  
  <pre><code>    require 'mysql_con.php';
      require 'simple_html_dom.php';
  
      $html = file_get_html('http://www.xxxx.com/index.php?main_page=index&amp;cPath=23');
  
      /* foreach($html-&gt;find('img') as $element) {
             echo $element-&gt;src . '&lt;br&gt;'; 
          }    */
  
      $find = $html-&gt;find('#specialsListing .specialsListBoxContents .indent a');
  
      $i=0;
  
      foreach ($find as $test) {
  
          $link = html_entity_decode($test-&gt;href);
  
          $linkgrab = file_get_html($link);
  
          $product_name = $linkgrab-&gt;find('#productName')-&gt;innertext;
  
          echo $product_name;
  
          break;
  
      }
  </code></pre>