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); }
[download]
Thanks for your help... ---mmmmtmmmm