using Perl to auto-login to capitalone.com

From: Andrew Gaffney (agaffney_at_skylineaero.com)
Date: 01/28/04


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


Relevant Pages

  • Re: Help trying to login to myspace programatically in vb.net
    ... 'Dim myspacecookies As New Net.CookieContainer ... you should get the login page from a config file. ... Dim response As System.Net.WebResponse = Nothing ... ' You need to capture the cookies at this point and use ...
    (microsoft.public.dotnet.general)
  • Re: using Perl to auto-login to capitalone.com
    ... HTH, ... but Capitalone's login is a pain in the ass to wrap my head around. ... On one of the last pages, it has JavaScript that generates some more cookies. ...
    (perl.beginners)
  • Re: login OWA of Exchange 2007 using .NET2003
    ... Actually the objective of my ASP.NET program is to login the FBA page ... then I will implant the cookies returned to the user's browser, ... it seems it has already logined the OWA. ... // implant the cookies returned from exchange server to user's browser ...
    (microsoft.public.exchange.development)
  • Re: HTTPS-Client bringt Fehler beim Wechsel von getIntputStream() auf getOutputStream
    ... d.h. hieße, wenn ich den Login mal durch habe, auch meinen Login? ... Genau aus dem Grund werden ja Dinge wie Cookies oder Werte ... | muss zunächst eine weitere Verbindung aufgebaut werden. ... Nur, wenn die Session an die SSL-Session gebunden ist, was ...
    (de.comp.lang.java)
  • Re: Limiting access to a website
    ... You might consider having a single login for the whole club, if the data you're hiding is not confidential. ... This will cut down on your coding time a bit, and you can still use cookies to bypass the login after the first time. ... confident to shop on Amazon. ...
    (comp.lang.php)