title: PHP cURL not being allowed?
body: <p>I'm trying to scrape a page with the use of cURL but all of my attempts doesn't work.</p>
  
  <p>Here's my code:</p>
  
  <h3>PHP</h3>
  
  <pre><code>public function curl($url) {
      $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, $url);
          curl_setopt($ch, CURLOPT_HEADER, true);
          curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      $data = curl_exec($ch);
  
      $loc = null;
      if(preg_match('#Location: (.*)#', $data, $r)) {
          $loc = trim($r[1]);
      }
  
      echo "&lt;pre&gt;";
      echo var_dump($data);
      echo "&lt;/pre&gt;";
      echo "&lt;pre&gt;";
      echo var_dump($loc);
      echo "&lt;/pre&gt;";
      die();
  
      return $data;
  }
  </code></pre>
  
  <p>The response I get by running that is the following:</p>
  
  <pre><code>HTTP/1.1 503 Service Temporarily Unavailable
  Date: Wed, 28 Dec 2016 20:29:28 GMT
  Content-Type: text/html; charset=UTF-8
  Transfer-Encoding: chunked
  Connection: close
  Set-Cookie: __cfduid=d6f3effa0b8c33cd8092e9f003d5c751c1482956968; expires=Thu, 28-Dec-17 20:29:28 GMT; path=/; domain=.thedomaintoscrape.com; HttpOnly
  X-Frame-Options: SAMEORIGIN
  Refresh: 8;URL=/cdn-cgi/l/chk_jschl?pass=1482956972.162-3LFzqX3Gdh
  Cache-Control: no-cache
  Server: cloudflare-nginx
  CF-RAY: 3187c3bb054a551c-ORD
  </code></pre>
  
  <p>I don't really know what to make of it as I don't understand what the problem is. Can anyone help me?</p>