title: How to get AJAX URL from a website using PHP/cURL
body: <p>My task is to get product list with prices from the link:
  <a href="http://www.sanalmarket.com.tr/kweb/sclist/30011-tum-meyveler" rel="nofollow">http://www.sanalmarket.com.tr/kweb/sclist/30011-tum-meyveler</a></p>
  
  <p>Namely, I want to get this URL (or a better alternative):
  <a href="http://www.sanalmarket.com.tr/kweb/getProductList.do?shopCategoryId=30011" rel="nofollow">http://www.sanalmarket.com.tr/kweb/getProductList.do?shopCategoryId=30011</a>
  (By the way, I cannot reach this URL on my own hook using PHP).</p>
  
  <p>To get the cookie from original URL (first one) was simple:</p>
  
  <pre><code>&lt;?php
  
  $ch = curl_init('http://www.sanalmarket.com.tr/kweb/sclist/30011-tum-meyveler/');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_HEADER, 1);
  $result = curl_exec($ch);
  preg_match('/^Set-Cookie:\s*([^;]*)/mi', $result, $m);
  
  parse_str($m[1], $cookies);
  var_dump($cookies);
  $cookie1 = reset($cookies);
  
  echo $cookie1;
  
  ?&gt;
  </code></pre>
  
  <p>Nevertheless, I cannot find a way to use this info to reach any JSON file or the URL which contains product info. I want to scrape the AJAX URL the website triggers to show the product list. Is there a way to do that?</p>
  
  <p>Thank you in advance.</p>