title: Fatal error: Uncaught Error: Call to a member function find() on string while parsing data
body: <p>So I am trying to get some information from this webpage <a href="https://promo.pan.com.hr" rel="nofollow noreferrer">https://promo.pan.com.hr</a> with curl and simple HTML dom. But unfortunately, I keep receiving an error and I can't figure it out what is wrong...</p>
  
  <pre><code>&lt;?php
  include_once("simple_html_dom.php");
  function file_get_contents_curl($url)
  {
  $ch = curl_init();
  
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  
  $data = curl_exec($ch);
  curl_close($ch);
  
  return $data;
  }
  
  $html = file_get_contents_curl("https://promo.pan.com.hr");
  
  
  foreach($html-&gt;find("p") as $element)
  echo $element-&gt;innertext . '&lt;br&gt;';
  ?&gt;
  </code></pre>
  
  <p>Anyone knows why I am getting this error?</p>
  
  <p>Fatal error: Uncaught Error: Call to a member function find() on string in C:\Server\XAMPP\htdocs\pan\index.php:21 Stack trace: #0 {main} thrown in C:\Server\XAMPP\htdocs\pan\index.php on line 21 </p>
  
  <p>line 21 is:</p>
  
  <pre><code>foreach($html-&gt;find("p") as $element)
  </code></pre>