我试图教自己如何网上搜索酒店数据。
<?php
$url = "https://www.google.com/hotels/#search;l=Denpasar-Bali+Ngurah+Rai,+Denpasar,+ID;d=2015-04-30;n=6;usd=1;si=dc7b320c;av=r";
$curl_connection = curl_init($url);
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, False);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
$result = curl_exec($curl_connection);
echo $result;
?>
我无法从Google获取任何酒店数据。所以只想在刮取酒店数据方面寻求帮助。
答案 0 :(得分:0)
你的案子很特别。你试图刮掉google的酒店目录。