title: how can i make my curl wait for few seconds before scraping?
body: <p>So I am trying to scrape some data from a site.
  There are list of names that has to be scraped.
  What happens is that, if there are 15 names that needs to be scraped. Out of that only 5 names are scraped.</p>
  
  <p>When I checked the original site, they too load the data in similar way. On loading the site for first time. Only five names are displayed. On reloading 10 names are displayed and trying again shows all 15 data.</p>
  
  <p>Can anybody tell me how to make my cURL wait for few seconds before scraping the original data. so that all of the content can be scraped?</p>
  
  <p>Here is the part snippet of the code with curl set options:</p>
  
  <pre><code>    $post = curl_init();
      curl_setopt($post, CURLOPT_URL, $url);
      curl_setopt($post, CURLOPT_AUTOREFERER, true);
      curl_setopt($post, CURLOPT_FOLLOWLOCATION, true);
      curl_setopt($post, CURLOPT_RETURNTRANSFER, 1 );
      curl_setopt($post, CURLOPT_TIMEOUT, 2 );
      $img_contents = curl_exec($post);
      curl_close($post);
  
      $html= str_get_html($img_contents);
  foreach($html-&gt;find('div[id=xxxx]') as $stay2)
  {
  
  $stay4=$stay2-&gt;find('span[class=xxx]');
  
      foreach($stay4 as $stay6)
      {   
          echo $abc[]= strip_tags($stay6) ."&lt;br/&gt;";
      }
   }
  </code></pre>