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

I dont know if this is possible through perl (if not I'll write a VB program that grabs the info and passes it to perl) but I need to write a perl program that posts a user name and password to a form, and then after the user is logged in, the next pages html code is stored in a variable

The reason I need to do this is, I'm automating my Ebay account and I want it to log into my account, grab the first webpage and email all the winning bidders a URL on where to download their programs. I can do the latter part of the program myself using snippits of code (I never really got to far into perl) but I dont know how to post data to a form and get the next web page. any help would be greatly apreachiated!
thanks

Replies are listed 'Best First'.
Re: perl post data to form?
by gube (Parson) on Sep 08, 2005 at 04:41 UTC
    use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->get('https://www.paypal.com/us'); $mech->submit_form( form_number => 1, fields => { login_email => 'sss', login_password => 'sss', } ); die unless ($mech->success); print $mech->content();
Re: perl post data to form?
by NetWallah (Canon) on Sep 08, 2005 at 04:37 UTC
Re: perl post data to form?
by saintmike (Vicar) on Sep 08, 2005 at 04:44 UTC
    If you'd rather comply with their TOS and use their API, check their developer page. Rumor has it it's free now.
Re: perl post data to form?
by sk (Curate) on Sep 08, 2005 at 04:34 UTC