use strict; use Data::Dumper; use Carp; use WWW::Mechanize; use WWW::Mechanize::Firefox; use WWW::Mechanize::Sleepy; my $address = 'http://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastn&BLAST_PROGRAMS=megaBlast&PAGE_TYPE=BlastSearch&SHOW_DEFAULTS=on&LINK_LOC=blasthome'; my $outfile = "outnewww.htm"; my $file = "n.txt"; my $organism = "Aspergillus"; my $mech = WWW::Mechanize->new(); #my $mech = WWW::Mechanize::Sleepy->new(sleep=>1); $mech->get($address); sleep (10); $mech->field( 'QUERYFILE', $file); $mech->field( 'qorganism', $organism); $mech->set_fields( # But the rest of these fields are recognized 'QUERYFILE' => $file, 'qorganism' => $organism ); $mech->submit; #my $result = $mech->content(); #print "$result\n"; my $output_page = $mech->content(); open(OUTFILE, ">$outfile"); print OUTFILE "$output_page"; close(OUTFILE);