Hi,
Can anyone help me please? I am trying to simulate form submission. This is what I have tried. But the form->click() function does not seem to submit the form. When I try to download a page after that, it still downloads the page that says that I need to submit siteid, username and password.
Thanks.
#!/usr/bin/perl use HTTP::Cookies; use HTML::Form; use LWP; use URI; require 'dumpvar.pl'; my $sId = 'siteID'; my $log = 'username'; my $pswd = 'password'; my $ua = LWP::UserAgent->new(); my $url = 'http://xxx.yyy.html'; my $login_req = HTTP::Request->new(GET => $url); my $login_res = $ua->request($login_req); my $html = $login_res->content; my $form = HTML::Form->parse($html, "http://xxx.yyy.html"); #dumpValue(\$form); $form->value('site', $sId); $form->value('user', $log); $form->value('pass', $pswd); $form->click; $url = 'http://xxx.yyy.html'; $login_req = HTTP::Request->new(GET => $url); $login_res = $ua->request($login_req); print $login_res->content;
Edited 2001-10-18 by Ovid
In reply to Problem with automated form submission by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |