PHP 与 Google 的抓取问题“我感觉很幸运”

发布于 2024-08-11 11:54:57 字数 622 浏览 5 评论 0原文

我正在尝试使用 Google“手气不错”按钮进行抓取。

对于像“iteminfo.ca”这样的小查询,它可以工作,因为它将我重定向到 iteminfo.ca。

这是查询网址:

http://www.google.com/search?hl=en&source=hp&q=iteminfo.ca&btnI=I%27m+Feeling+Lucky

但是对于像“061754020164 site:iteminfo.ca”这样的查询,它不起作用:

http://www.google.com/search?hl=en&q=061754020164+site%3Aiteminfo.ca&btnI=I%27m+Feeling+Lucky

因为它没有重定向到 http://www.iteminfo.ca/Product.aspx?id=1011972978 就像您使用该查询并点击“手气不错”时一样谷歌主页。

任何想法我做错了什么。

I'm trying to scrape using Google "I'm Feeling Lucky" button.

For small query like 'iteminfo.ca' it works, because it redirects me to iteminfo.ca.

This is the query url:

http://www.google.com/search?hl=en&source=hp&q=iteminfo.ca&btnI=I%27m+Feeling+Lucky

But for the query like '061754020164 site:iteminfo.ca' it doesn't work :

http://www.google.com/search?hl=en&q=061754020164+site%3Aiteminfo.ca&btnI=I%27m+Feeling+Lucky

Because it is not redirecting to http://www.iteminfo.ca/Product.aspx?id=1011972978 as it does when you use that query and hit 'I'm Feeling Lucky' on google homepage.

Any ideas what I'm doing wrong.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云之铃。 2024-08-18 11:54:57

尝试使用 Google 搜索 API 而不是屏幕抓取。

这里有更多信息,包括 PHP 示例代码:

http://code.google.com/apis /ajaxsearch/文档/

Try using the Google Search API rather than screen-scraping.

There's more information here, including PHP example code:

http://code.google.com/apis/ajaxsearch/documentation/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文