【发布时间】:2015-02-08 06:59:39
【问题描述】:
我正在尝试使用 Goutte(它基本上是 Guzzle + Symfony DOM 解析器的包装器)从谷歌搜索 reverse image search 结果。
我在做:
$googleURL = "https://www.google.com/searchbyimage?&image_url=".$imageURL;
$crawler = $client->request('GET', $googleURL);
$client->followRedirects(true);
print_r($crawler,1);
.. 并且输出 (https://paste.ee/p/spfYA) 包含正确的 URL,但 body (HTML) 是默认搜索页面,即没有结果的页面。
我应该怎么做才能获得 HTML 格式的搜索结果。
【问题讨论】:
-
经过几次请求后,Google 将禁止您的 IP。所以你可能需要改用他们的 API-s
-
没关系,几天之内我只需要买几百个。此外,没有用于反向图像搜索的 API。
标签: php symfony web-scraping guzzle goutte