Have you look at WWW::Mechanize on CPAN. It seems to make navigating sites (virtually) and using forms, etc. much easier.
It's worth a shot. HTH, Kevin On Wed, 2004-01-28 at 02:37, Andrew Gaffney wrote: > I am attempting to write a Perl script that can login to my account at > capitalone.com, > grab my balance and available credit and email them to me. I did this successfully > with my > online banking, but Capitalone's login is a pain in the ass to wrap my head around. > It > redirects you through 3 or pages before an actual login screen and sets cookies at > each > one. On one of the last pages, it has JavaScript that generates some more cookies. > So far, > I've got: > > > #!/usr/bin/perl > > use LWP::UserAgent; > use HTTP::Cookies; > > my $res, $req; > my $ua = LWP::UserAgent->new; > $ua->cookie_jar(HTTP::Cookies->new(file => "bankcookies.txt", autosave => 1)); > > $req = HTTP::Request->new(GET => 'http://www.capitalone.com/indexrfa.php'); > $res = $ua->request($req); > #$req = HTTP::Request->new(GET => > 'http://www.capitalone.com/redirect.html?Log=1&linkid=WWW_Z_Z_Z_HMLFT_L1_01_G_OASL&dest=https://service.capitalone.com/cgi/Home?Login'); > #$res = $ua->request($req); > #print $res->as_string; > $req = HTTP::Request->new(GET => 'https://service.capitalone.com/cgi/Home?Login'); > $res = $ua->request($req); > #print $res->as_string; > $req = HTTP::Request->new(GET => > 'https://service.capitalone.com/oas_secure/oas/login.do?objectclicked=LoginSplash'); > $res = $ua->request($req); > print $res->as_string; > > > I'm not sure how much of the above is actually necessary, but those are the pages > that you > go through when manually logging in. That last page is where it starts using > JavaScript to > generate cookies just to make sure that you have JavaScript and cookies enabled in > the > browser. Can anyone help me out? Thanks. > > -- > Andrew Gaffney > System Administrator > Skyline Aeronautics, LLC. > 776 North Bell Avenue > Chesterfield, MO 63005 > 636-357-1548 -- Kevin Old <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>