DougMcq has asked for the wisdom of the Perl Monks concerning the following question:
I'm using WWW::Mechanize and having an intermittent problem when executing a series of Google searches. Currently less than 100 but wish to scale significantly. It's a state problem of some sort. If I wait a bit, the script will execute properly. The error message follows "Error GETing htIndexRedirect?tps://ipv4.google.com/sorry/continue...ECHOS-MY-REQUESTED-URL....Service Unavailable at script line nnn"
#!/usr/bin/perl # create a new browser use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new());
sub GETURL { $start_time = time; $output_buffer = ""; print OUTDATA "Retrieving $_\n"; if ($mech->get("$_")) { $_ = $mech->content(); $time = time-$start_time; print OUTDATA "Seconds $time\n"; while (s/\n\n/\n/) {} } else { print OUTDATA " ERROR\n";} sleep (1); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Google Not Liking Repetitive GETs
by Anonymous Monk on Mar 11, 2015 at 00:02 UTC | |
by DougMcq (Initiate) on Mar 28, 2015 at 01:59 UTC | |
by choroba (Cardinal) on Mar 28, 2015 at 02:07 UTC | |
by Anonymous Monk on Mar 28, 2015 at 08:37 UTC |