in reply to Re: Automating an HTML form submission with only required user info
in thread Automating an HTML form submission with only required user info
HTML::Form is simpler to use for this sort of thing than HTML::FormParser (and comes with LWP, so it's probably more available).
This will extract the first form from the HTML held in $page ($url is used to resolve relative URLs), and then q1 has its value set to $target. Finally, we return an HTTP::Request object (representing the form submission). If you want to turn this into a URL, then invoke uri_as_string on it.my $form=HTML::Form->parse($page, $url); $form->find_input('q1')->value($target); return $form->click;
--
Tommy
Too stupid to live.
Too stubborn to die.
|
---|