See if this works for you:
use strict; use warnings; use WWW::Mechanize; my $base_url = 'http://igs-server.cnrs-mrs.fr/'; my $start_url = $base_url . 'Tcoffee/tcoffee_cgi/index.cgi?action=Make +%20a%20multiple%20alignment::Advanced&stage1=1'; my $upload = '/tmp/scratch/dummy.fasta'; my $mech = WWW::Mechanize->new(); $mech->get( $start_url ); $mech->form_number(1); $mech->set_fields(email => "", -uploaded_file => $upload, -case => "up +per", -seqnos => "off", -outorder => "input",); $mech->tick(-in => "Mlalign_id_pair"); $mech->tick(-in => "Mfast_pair"); $mech->tick(-in => "Mclustalw_aln"); $mech->tick(-output => "fasta_aln"); $mech->tick(-output => "score_html"); $mech->submit(); $| = 1; { my $refresh = $mech->res->header( 'refresh' ); last unless defined $refresh; my ( $wait, $rel_url ) = $refresh =~ m,^(\d+)\s*;\s*URL=/(.+)$,; die 'match failed' unless defined $wait; sleep $wait; my $url = $base_url . $rel_url; # uncomment the next line if you want to track the progress # print "Fetching $url\n"; $mech->get( $url ); redo; } # at this point, $mech->content should give you the page you want. my $html = $mech->content;
the lowliest monk
In reply to Re^4: Navigating with WWW::Mechanize across intermediate pages
by tlm
in thread Navigating with WWW::Mechanize across intermediate pages
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |