Jef*_*eff 2 php file-get-contents
我正在尝试使用 PHP 返回 Google 搜索结果的 HTML。
例如
<?php
$file = file_get_contents('http://www.example.com',false);
echo $file;
?>
Run Code Online (Sandbox Code Playgroud)
将返回 example.com 的 HTML 内容。问题是,当我尝试在 Google 搜索 URL(例如http://www.google.com/#sclient=psy&hl=en&q=cats )上执行此操作时,它会从 Google 主页返回 HTML,而不是搜索“猫”的搜索结果。
做到这一点最简单的方法是什么?