我想關於如何迫使這個腳本解釋谷歌的網址提示,好像我做了谷歌的研究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