Ah - again, it's my error, as the API for ->click() does not want a hash but a hash reference when passing in elements and instructions for "blindly" clicking things. I've taken out your calls to sleep and added some warnings for the progress. The main change is from
to$agent->click($method_field, synchronize => 0 );
$agent->click({ dom => $method_field, synchronize => 0 });
use strict; use WWW::Mechanize::Firefox; my $url = "http://tools.immuneepitope.org/tools/bcell/iedb_input"; my $agent = WWW::Mechanize::Firefox->new( activate => 1, autoclose => 0, ); my $method = 49; my $seq = "ARRRSFASDATRASDFSDARASDAGADFGASDRFREWFASCDSAGAREW"; $agent->get($url); if ( $agent->success() ) { #sleep(5); print "Retrieved $url\n"; $agent->form_name('form1'); #$agent->set_fields( 'sequence' => $seq,'method' => $method); $agent->field( 'sequence' => $seq ); my $q = sprintf '//input[@name="method" and @value="%s"]', $method +; my $method_field = $agent->xpath( $q, single => 1 ); warn "Method"; $agent->click({ dom => $method_field, synchronize => 0 }); #sleep(5); warn "Submitting"; $agent->submit(); }
In reply to Re^5: WWW::Mechanize::Firefox not filling out form
by Corion
in thread WWW::Mechanize::Firefox not filling out form
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |