如何使用 Perl 的 Google::Search 来查找特定的 URL?
基于 AJAX 搜索 API 的 Google::Search 模块似乎工作得不太好,或者只是我的问题?
例如,我使用 Firefox 在 google 中搜索: http://bloggingheads.tv/forum /member.php?u=12129
它带来了结果。
但是当我以这种方式使用该模块时:
$google_search = Google::Search->Web ( q => "http://bloggingheads.tv/forum/member.php?u=12129" );
@result = $google_search->all;
我在数组中什么也没有得到。
有什么想法吗?
似乎这个 API 并没有带来与手动搜索相同的结果,我是否遗漏了一些东西?
The Google::Search module, which is based on the AJAX Search API, doesn't seems to work very well, or it is just me?
For example, I use firefox to search google for: http://bloggingheads.tv/forum/member.php?u=12129
It brings results.
But when I use the module this way:
$google_search = Google::Search->Web ( q => "http://bloggingheads.tv/forum/member.php?u=12129" );
@result = $google_search->all;
I get nothing in the array.
Any idea?
Seems like this API doesn't bring the same results like when searching manually, am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在西里尔文查询中也遇到了类似的问题。 CPAN 的
Google::Search
和REST::Google
都不适合我 - 与手动测试相比,它们返回的结果较少或没有。最终我使用 WWW::Mechanize 和 HTML::TreeBuilder 编写了一个抓取模块。
这是获取结果统计信息的示例:
I had a similar problem with cyrillic queries. Both
Google::Search
andREST::Google
from CPAN didn't work for me - they were giving back fewer or no results compared to manual test.Eventually I wrote a scraping module using
WWW::Mechanize
andHTML::TreeBuilder
.Here's a sample to get result stats:
查看 Google::Search 的 POD ,看起来它希望您将搜索词传递到
Web
,而不是 URL。我从 CPAN 下载了测试脚本,并运行了它,它似乎产生了预期的结果:我意识到这并没有具体回答你的问题,但也许它会引导你走向正确的方向。
Looking at the POD for Google::Search, it looks like it expects you to pass search terms to
Web
, instead of a URL. I downloaded a test script from CPAN, ran it, and it seems to produce expected results:I realize this does not specifically answer your question, but perhaps it steers you in the right direction.