Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

mmmmtmmmm's scratchpad

by mmmmtmmmm (Monk)
on Aug 27, 2007 at 18:47 UTC ( [id://635380]=scratchpad: print w/replies, xml ) Need Help??

Hi there: I am trying to use WWW::Mechanize to sign into Ebay. I am having a problem dealing with redirection. I am still learning Perl, so I might have missed something simple... I am getting an error page from ebay that says my browser is not allowing me to get redirected. What am I missing here? Here is the code I have so far.
#!/usr/bin/perl -w use strict; use WWW::Mechanize; use Crypt::SSLeay; my $robot=WWW::Mechanize->new(); $robot->agent('Mozilla/5.0'); my $login_url='https://signin.ebay.com/ws/eBayISAPI.dll?SignIn&UsingSS +L=1'; my ($username, $password) = get_pass(); print "\n\n"; $robot->get($login_url) or die "Couldn't fetch the login page.\n"; $robot->form_name('SignInForm'); my %myfields=( 'userid' => $username, 'pass' => $password, ); $robot->set_fields(%myfields); push @{ $robot->requests_redirectable }, 'POST'; $robot->click_button(value => 'Sign In Securely >'); print $robot->content(); sub get_pass{ use Term::ReadKey; print "Please enter your ebay username and password:\n"; print "Username: "; chomp (my $username = <STDIN>); print "Password: "; ReadMode ('noecho'); chomp (my $password = <STDIN>); ReadMode ('restore'); return ($username, $password); }
Thanks for your help... ---mmmmtmmmm
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-24 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found