我想关于如何迫使这个脚本解释谷歌的网址提示,好像我做了谷歌的研究PHP:如何解释谷歌网址
<?php
$ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, 'http://www.google.com/?q=cr#hl=fr&q=help+me+please&psj=1&oq=variable+get+google+recherche&fp=1/');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
$lines = array();
$lines = explode("\n", $file_contents);
foreach($lines as $line_num => $line) {
echo "Line # {$line_num} : ".htmlspecialchars($line)."<br />\n";
}
?>
这是我来什么与,但是当我在我的服务器上尝试这一点时,我只收到google.com源代码,而不是研究后谷歌网页的源代码。
任何人都可以帮助我吗?谢谢:D
这是因为AJAX的。 – SLaks 2012-02-23 16:34:46
可能的重复[我想cURL谷歌搜索结果在PHP](http://stackoverflow.com/questions/9392818/i-want-to-curl-google-search-result-in-php) – Quentin 2012-02-23 16:43:12