in reply to Re^3: Navigating with WWW::Mechanize across intermediate pages
in thread Navigating with WWW::Mechanize across intermediate pages

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

Replies are listed 'Best First'.
Re^5: Navigating with WWW::Mechanize across intermediate pages
by Anonymous Monk on Jun 23, 2005 at 07:58 UTC
    Oh my god... you really wrote this for me... Thank you a lot... I will try it out for sure.
Re^5: Navigating with WWW::Mechanize across intermediate pages
by Anonymous Monk on Jun 23, 2005 at 08:33 UTC
    Great great great... Thank you again.