cheech has asked for the wisdom of the Perl Monks concerning the following question:
However, for some reason I keep getting this error once I get to the the date 18961110 (November 10 of 1896).
Error GETing http://bub2.meteo.psu.edu/wxstn/wxstn.htm: Can't connect to bub2.me teo.psu.edu:80 (connect: timeout) at C:\Perl\scripts\i.pl line 19The data for this date is available and I can access it manually by logging on to the site, so it's not that the server doesn't recognize the date.
What could be causing my program to fail at the same date each time? Also, it took about 3 minutes to get through October of the first year, yet I have over 100 years to go through. Is there any way for me to improve this code so that it was run faster?
Thanks a lot for any suggestions or advice!
use strict; use warnings; open(my $in, '<', "c:/perl/scripts/dates/dates.txt") or die "open: $!\n"; my @date; while (<$in>) { chomp; push(@date, $_); } close($in); use WWW::Mechanize; foreach my $date (@date) { my $mech = WWW::Mechanize->new(); $mech->get( "http://bub2.meteo.psu.edu/wxstn/wxstn.htm" ); $mech->form_number(1); $mech->field( 'dtg' , $date ); $mech->click(); $mech->content(); my $file = "c:/perl/scripts/dates/$date.txt"; $mech->save_content($file); $mech->back(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Connection Timeout duing form submissions
by Perlbotics (Archbishop) on Jun 20, 2009 at 21:07 UTC | |
by cheech (Beadle) on Jun 20, 2009 at 21:14 UTC | |
by Marshall (Canon) on Jun 20, 2009 at 22:53 UTC | |
|
Re: Connection Timeout duing form submissions
by Marshall (Canon) on Jun 20, 2009 at 21:01 UTC | |
by cheech (Beadle) on Jun 20, 2009 at 21:11 UTC | |
by Marshall (Canon) on Jun 20, 2009 at 21:37 UTC | |
by cheech (Beadle) on Jun 20, 2009 at 21:51 UTC | |
|
Re: Connection Timeout duing form submissions
by Anonymous Monk on Jun 21, 2009 at 02:48 UTC | |
|
Re: Connection Timeout duing form submissions
by Anonymous Monk on Jul 15, 2009 at 14:16 UTC |