title: Extract website html data using php
body: <p>i use this code to Extract website <a href="https://billing.te.eg/Arabic/BillStatus.aspx?Acc=A4000917512" rel="nofollow"><a href="https://billing.te.eg/Arabic/BillStatus.aspx?Acc=A4000917512" rel="nofollow">https://billing.te.eg/Arabic/BillStatus.aspx?Acc=A4000917512</a></a></p>
  
  <p>but i have a error <code>Fatal error: Call to a member function find() on a non-object in index.php</code> 
  and what i want to Extract it between span elemant like <code>&lt;span id="SpanPhoneNumber" dir="ltr"&gt;02-26981106&lt;/span&gt;</code> or <code>&lt;span id="SpanCurrentBalance"&gt;19.30&lt;/span&gt;</code></p>
  
  <pre><code>include_once("simple_html_dom.php");
  //use curl to get html content
  function getHTML($url,$timeout)
  {
         $ch = curl_init($url); // initialize curl with given url
         curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]); // set  useragent
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // write the response to a variable
         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // follow redirects if any
         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // max. seconds to execute
         curl_setopt($ch, CURLOPT_FAILONERROR, 1); // stop when it encounters an error
         return @curl_exec($ch);
  }
  $html=getHTML("https://billing.te.eg/Arabic/BillStatus.aspx?Acc=A4000917512",10);
  // Find all images on webpage
  foreach($html-&gt;find("img") as $element)
  echo $element-&gt;src . '&lt;br&gt;';
  
  // Find all links on webpage
  foreach($html-&gt;find("a") as $element)
  echo $element-&gt;href . '&lt;br&gt;';
  </code></pre>