use WWW::Mechanize; use Fortran::Format; my $mech = WWW::Mechanize->new(); $mech->get($url); foreach my $date (@dates) { $mech->form_number(1); $mech->field('dtg',"$date"); $mech->click(); my $page = $mech->content(format=>'text'); my @data = ($page =~ /:\s\s\s\s(\d\d)/g); my @rain = ($page =~ /Rain or Liquid Equivalent\s+:\s+(\S*)/); my @snow = ($page =~ /Snow and\/or Ice Pellets\s+:\s+(\S*)/); my @depth = ($page =~ /Snow Depth\s+:\s+(\S*)/); my @hdd = ($page =~ /Degree-Days\s+:\s+(\S*)/); my $f = Fortran::Format->new("(I2.1,2X)")->write($hdd[0]); @hlahdd = ("$date $data[0] $data[1] $data[2] $f"); print "@hlahdd"; print FH "@hlahdd"; sleep .1; $mech->back(); }