Hi
I've been trying to write a script which can log into Yahoo and retrieve
information on my current auctions. Seems simple enough, but I keep
getting "The browser you're using cannot sign in (refuses cookies)" back
from Yahoo; I can't see why. Nothing bad comes out of the debug messages.
Can anyone see anything wrong with this code (below)?
Cheers
M
--
Matthew Smith | Business: http://www.kbc.net.au
IT Consultant | PGP Key: http://gpg.mss.cx
Kadina, South Australia | * Tivis Project * Community Connect *
#!/usr/bin/perl -wT
use strict;
use LWP::UserAgent;
use URI::Escape;
use HTTP::Cookies;
use LWP::Debug qw(+);
# Yahoo Login Page
my $target="http://login.yahoo.com/config/verify";
# Destination once logged in
my
$done=uri_escape("http://au.page.sold.yahoo.com/au/show/mystatus?select=bidding");
# Query String - note that login and password have been
# removed for this posting
my
$content="hasMsgr=0&.chkP=Y&login=*****&passwd=*****&.persistent=y&.save=Sign%20In&.tries=1&.src=auc&.done=$done";
my $ua=LWP::UserAgent->new;
my $cookie_jar=HTTP::Cookies->new(file=>"lwpcookies.txt", autosave=>1);
$ua->cookie_jar( $cookie_jar );
$ua->agent("Lynx/1.0 ");
my $req=HTTP::Request->new(POST=>$target);
$req->content_type('application/x-www-form-urlencoded');
$req->content($content);
my $res=$ua->request($req);
# De-reference the response hash
my %reshash=%$res;
# Print the responses
while ( my($k, $v)= each %reshash) {
print "$k => $v\n";
}
- Re: Cookies: Do I Yahoo? Matthew Smith
- Re: Cookies: Do I Yahoo? Iain 'Spoon' Truskett
- RE: Cookies: Do I Yahoo? Thurn, Martin
