#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; # field name: inseq my $url = q|http://thr.cit.nih.gov/molbio/hla_bind/index.shtml|; my $seq = 'EALLKQSWEVLKQNIPGHSLCLFALIIEAAPESKYVFSFLKDSNEIPENNPKLKAHAAVIFKTICESATE LRQKGQAVWDNNTLKRLGSIHLKNKITDPHFEVMKGALLGTIKEAVKENWSDEMCCAWTEAYNQLVATIK AEMKE'; my $mech = WWW::Mechanize->new() or die "couldn't get Mech object: $!"; $mech->get($url) or die "couldn't 'get': $!"; $mech->submit_form( form_number => 1, fields => { inseq => $seq, } ) or die "couldn't submit form"; my $html = $mech->content() or die "content failed: $!"; { my $file = 'bio_output.html'; open my $fh, '>', $file or die "can't open $file: $!"; print $fh $html; close $fh; }