in reply to Filling out a form on password page

Have a look at WWW::Mechanize. It can help you with the authentication/form part.

An example for simple form-filling:

#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $page = "http://www.heise.de/newsticker/"; $mech->get($page); $mech->form_number('2'); $mech->field('T' => 'SCO'); my $results = $mech->submit(); print $results->content(), "\n";
best regards,
neniro

Replies are listed 'Best First'.
Re: Re: Filling out a form on password page
by Anonymous Monk on Mar 11, 2004 at 16:22 UTC
    #!/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?
      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