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?
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.
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: