http://qs1969.pair.com?node_id=472303

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Is there any module to submit a form using a perl module? with out having to click the submit button manually? We are looking to automate some of the stuff. Thanks a lot Hemanth

Replies are listed 'Best First'.
Re: Submit a form using perl module
by Corion (Patriarch) on Jul 04, 2005 at 21:18 UTC

    Yes. There is WWW::Mechanize, which is the easiest method. There also is HTTP::Request, which is the hard way, and which is what WWW::Mechanize uses.

      The user places the request using LWP (LWP::UserAgent, even) rather than HTTP::Request, as shown in the following example:

      use HTTP::Request::Common; $ua = LWP::UserAgent->new; $ua->request(POST 'http://example.com/survey.cgi', [ name => 'Gisle Aas', email => 'gisle@aas.no', gender => 'M', born => '1964', perc => '3%', ]);

      HTTP::Request could have been used instead of HTTP::Request::Common.