dannoura has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm trying to use the module WWW::Search with the backend WWW::Search::Altavista, using the code:

#! c:\perl\bin use WWW::Search; my $oSearch = new WWW::Search('AltaVista'); my $sQuery = 'Ohio sushi restaurant'; $oSearch->native_query(WWW::Search::escape_query($sQuery)); my $response = $oSearch->response(); if ($response->is_success) { print "Page returned ok"; } else { print "error: " . $response->as_string(); } while (my $oResult = $oSearch->next_result()) { print $oResult->url, "\n"; } $oSearch->logout;

And I get:

Page returned ok

But no results (yes, there are sushi restaurants in Ohio). I tried:

my @asEngines = sort &WWW::Search::installed_engines(); local $" = ', '; print (" + These WWW::Search backends are installed: @asEngines\n");

Which gives:

 + These WWW::Search backends are installed: AltaVista, AltaVista::AdvancedNews, AltaVista::AdvancedWeb, AltaVista::Intranet, AltaVista::Intranet3, AltaVista::NL, AltaVista::News, AltaVista::Web, Null, Null::Count, Null::Empty, Null::Error, PubMed, Simple

So I know the engine is installed, but I get no results. Any ideas as to what the problem may be?

Replies are listed 'Best First'.
Re: searching altavista
by gjb (Vicar) on Jul 03, 2003 at 07:43 UTC

    I just ran your code and it returns quite a number of URLs for me (490 to be precise).

    I know from experience that AltaVista is not always stable, so it may be that you just picked the wrong moment for your test.

    I just installed a fresh copy of WWW::Search and WWW::Search::AltaVista though, so maybe it is version related?

    Hope this helps, -gjb-

    Update: Below is AltaVista's response.

      Well, I tried this on two machines and as far as I know I have the latest version for both WWW::Search and WWW::Search::Altavista (downloaded today).

      Can you please post the results it gave you?

      Thanks,

      Jon