我正在使用以下php脚本从Google获取搜索结果。
$useragent = "Opera/9.80 (J2ME/MIDP; Opera Mini/4.2.14912/870; U; id) Presto/2.4.15";
$ch = curl_init ("");
curl_setopt($ch, CURLOPT_URL, "http://www.google.com/search?hl=en&q=site:" . urlencode($url));
curl_setopt ($ch, CURLOPT_USERAGENT, $useragent); // set user agent
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
return $output = curl_exec ($ch);
curl_close($ch);
但我收到谷歌验证码。
那么有没有办法避免验证码,这样我才能得到结果?