using Perl to auto-login to capitalone.com
From: Andrew Gaffney (agaffney_at_skylineaero.com)
Date: 01/28/04
- Next message: Jeff 'Japhy' Pinyan: "Re: [Q] How to eval an EXPR once and make it stick"
- Previous message: Wiggins D Anconia: "Re: Best Encyption module for this task/goal"
- Next in thread: Kevin Old: "Re: using Perl to auto-login to capitalone.com"
- Reply: Kevin Old: "Re: using Perl to auto-login to capitalone.com"
- Reply: Luinrandir Hernsen: "capturing a webpage in a variable"
- Maybe reply: Wiggins D Anconia: "Re: using Perl to auto-login to capitalone.com"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Jan 2004 01:37:48 -0600 To: beginners <beginners@perl.org>
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
- Next message: Jeff 'Japhy' Pinyan: "Re: [Q] How to eval an EXPR once and make it stick"
- Previous message: Wiggins D Anconia: "Re: Best Encyption module for this task/goal"
- Next in thread: Kevin Old: "Re: using Perl to auto-login to capitalone.com"
- Reply: Kevin Old: "Re: using Perl to auto-login to capitalone.com"
- Reply: Luinrandir Hernsen: "capturing a webpage in a variable"
- Maybe reply: Wiggins D Anconia: "Re: using Perl to auto-login to capitalone.com"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|