in reply to Re: Filling out a form on password page
in thread Filling out a form on password page

#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $page = "https://www.realquest.com/jsp/rq.jsp?action=switch&page=ma +in"; $mech->get($page); $mech->form_number('1'); $mech->field('username' => 'test'); my $results = $mech->submit(); print $results->content(), "\n";
I am getting the error: There is no numbered form 1 at login.pl. How can this be when the URL I am using has atleast one form?

Replies are listed 'Best First'.
Re^3: Filling out a form on password page
by Anonymous Monk on Jul 27, 2007 at 18:02 UTC
    i have also different prolem. when i fill form like here: $mech->field('username' => 'test'); everythig goes ok, but when i fill it with some var: $mech->field('username' => $test); i should tell that var $test is passed as an sub arg. It tells me error: Died at /usr/local/lib/perl5/site_perl/5.8.8/WWW/Mechanize.pm line 1681. Any ideas? best gegards, rafael