title: PHP failed to open stream: HTTP request failed! 503 error
body: <p>I am using PHP Simple HTML DOM Parser to get a data from a website. I call this following function in  a while loop say for example 15 actors data to be scraped. what happens is after scraping data for 5 or 6 or somewhere in loop, it fails to open the stream and  breaks the script. I used try and catch function. but still i am not to fix it out. Actually my need is even if it fails in the middle of a loop, it has to go on till the end. Can anyone assit me pls. </p>
  
  <pre><code>    function get_data($actor)  {
          try { 
  
              $html = file_get_html('http://someurl.com', false, $context);
  
              if (isset($html)) { 
  
              $table1 =$html-&gt;find('table.table_border',0) ; 
                   // doing some process here
              }
  
          } catch(Exception $e) {
           echo $tt_id."-Failed once.&lt;br&gt;";
          }
  
      }
  </code></pre>
  
  <p>Sometimes i am getting the following error and the script stops.</p>
  
  <pre><code>        Warning: file_get_contents(http://someurl.com) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 503 Service Temporarily Unavailable 
  
          Fatal error: Call to a member function find() on a non-object in somefile.php on line 37
  </code></pre>