Kodlar aşağıdaki şekilde
function Baglan($url) {
$user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6';
$ct = curl_init();
curl_setopt($ct, CURLOPT_URL, $url);
curl_setopt($ct, CURLOPT_HEADER, false);
curl_setopt($ct, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ct, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ct, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ct, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ct, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($ct, CURLOPT_FOLLOWLOCATION, true);
curl_setopt ($ct, CURLOPT_REFERER, 'http://www.google.com/');
$cikti = curl_exec($ct);
curl_close($ct);
return $cikti;
}
echo $baglan = Baglan("https://www.agoda.com/tr-tr/pages/agoda/default/DestinationSearchResult.aspx?city=15190&pagetypeid=103&origin=TR&cid=1656782&tag=&gclid=&aid=159401&userId=bb2aea2a-baea-4563-b972-441b372d5bb8&languageId=32&languageFlag=tr&storefrontId=3¤cyId=176¤cyCode=TRY&htmlLanguage=tr-tr&trafficType=User&cultureInfoName=tr-TR&selectedproperty=103&checkIn=2018-02-13&checkOut=2018-02-14&los=1&rooms=1&adults=1&children=0&childages=&ckuid=bb2aea2a-baea-4563-b972-441b372d5bb8");
siteyi açabilsem preg_match_all ile istediğim verileri çekeceğim. Ama site içeriği gelmiyor bir türlü.