use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->agent('Mozilla/5.0'); $mech->proxy(['https', 'http', 'ftp'], 'http://202.41.70.84:6588'); open(DIR,"C:\\Users\\DELL\\Desktop\\Output\\outofBlat.txt") or die "Couldnt open"; open (FH1,">>C:\\Users\\DELL\\Desktop\\outoftables.html"); my@x=; $num=1; $input="chr21:36259390-36260987"; $url="http://genome.ucsc.edu/cgi-bin/hgTables?hgsid=304457625"; $mech->get($url); die $mech ->res->status_line unless $mech ->success ; #+ML::Form $form = $mech->form_name("mainForm"); foreach my $inputfield (@inputfields) { if ($inputfield=~/position/) { $mech->set_fields($inputfield=>$input); } } $mech->submit; die $mech ->res->status_line unless $mech ->success ; # If the form sends you somewhere, you can catch it : my $new_url = $mech ->response->request->uri->as_string ; $html= $mech->content; print $html; print FH1 $html;