Ask a Question related to PERL Beginners, Design and Development.
-
Andrew Gaffney #1
using Perl to auto-login to capitalone.com
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
Andrew Gaffney Guest
-
Cross Domain Auto Login
I have multiple asp.net websites living in different domains. The websites (pages, code, etc) are all identical. The databases driving the... -
perl module to prevent auto registration scripts
Hello all, I am writing a web based registration module. I want to prevent people writing automated scripts ( like using lwp ) and auto register... -
Windows Auto Login
Hi, this may not strictly be a lingo question, but I was hoping someone who has had a similar problem may have an answer. We have a digital... -
Auto Login on Solaris 8 x86
I need a way of doing an auto login of an user after a reboot. Is it possible? (on solaris 8 x86) --------------------------------------- Andre... -
perl\site\lib\auto\... (DLLs, LIB, EXP etc) to another location under your dev directory?
Would it be possible to move support files under perl\site\lib\auto\... (DLLs, LIB, EXP etc) to another location under your dev directory? I am... -
Luinrandir Hernsen #2
capturing a webpage in a variable
IS this how I capture a web page code to a variable?
print $req; ## ?????????????> #!/usr/bin/perl
>
> use LWP::UserAgent;
>
> my $req;
> my $ua = LWP::UserAgent->new;
> $req = HTTP::Request->new(GET => 'http://www.yahoo.com');
from here I can print at the code for the web page?
################################################## ######3
Luinrandir Hernsen Guest
-
Kevin Old #3
Re: using Perl to auto-login to capitalone.com
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 <kold@kold.homelinux.com>
Kevin Old Guest
-
Rob Dixon #4
Re: using Perl to auto-login to capitalone.com
Kevin Old wrote:
Seconded.>
> 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.
It's definitely worthwhile for well-behaved sites, but can be tricky
to debug if the site doesn't behave as you expect.
Rob
Rob Dixon Guest
-
Wiggins D Anconia #5
Re: using Perl to auto-login to capitalone.com
> I am attempting to write a Perl script that can login to my account at
capitalone.com,successfully with my> grab my balance and available credit and email them to me. I did thishead around. It> online banking, but Capitalone's login is a pain in the ass to wrap mysets cookies at each> redirects you through 3 or pages before an actual login screen andmore cookies. So far,> one. On one of the last pages, it has JavaScript that generates some<snip code>> I've got:
>
are the pages that you>
> I'm not sure how much of the above is actually necessary, but thoseusing JavaScript to> go through when manually logging in. That last page is where it startscookies enabled in the> generate cookies just to make sure that you have JavaScript andJust a couple thoughts. Make sure you aren't violating user agreements,> browser. Can anyone help me out? Thanks.
>
etc. Some instituitions could view this as a denial of service
depending on how often you intend to run it, etc.
Because you are looking to wrangle the HTTP request/response headers,
etc. there is a new (to me at least) extension for the Firebird
(Mozilla) browser, Live HTTP Headers, that allows you to view and
capture as you are browsing all of the actual response/request headers.
This might help show exactly what is happening in the browser making it
easier to mimic in LWP or whatever.
More here:
[url]http://www.texturizer.net/firebird/extensions/#livehttpheaders[/url]
Very cool for web app developers...
[url]http://danconia.org[/url]
Wiggins D Anconia Guest
-
John McKown #6
Re: capturing a webpage in a variable
On Wed, 28 Jan 2004, Luinrandir Hernsen wrote:
print $req->as_string; #print the html> IS this how I capture a web page code to a variable?
>>> > #!/usr/bin/perl
> >
> > use LWP::UserAgent;
> >
> > my $req;
> > my $ua = LWP::UserAgent->new;
> > $req = HTTP::Request->new(GET => 'http://www.yahoo.com');
> print $req; ## ?????????????
> from here I can print at the code for the web page?
>
--
Maranatha!
John McKown
John McKown Guest
-
Andrew Gaffney #7
Re: using Perl to auto-login to capitalone.com
It does not appear that this module would solve my problem. It won't handle the JavaScript
generation of cookies.
Kevin Old wrote:--> 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
Andrew Gaffney Guest
-
Andrew Gaffney #8
Re: using Perl to auto-login to capitalone.com
Wiggins d Anconia wrote:
That is a very cool plugin. It appears to work with Mozilla, also. I think that will help>>>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:
>>
>
> <snip code>
>>>>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.
>>
>
> Just a couple thoughts. Make sure you aren't violating user agreements,
> etc. Some instituitions could view this as a denial of service
> depending on how often you intend to run it, etc.
>
> Because you are looking to wrangle the HTTP request/response headers,
> etc. there is a new (to me at least) extension for the Firebird
> (Mozilla) browser, Live HTTP Headers, that allows you to view and
> capture as you are browsing all of the actual response/request headers.
> This might help show exactly what is happening in the browser making it
> easier to mimic in LWP or whatever.
>
> More here:
> [url]http://www.texturizer.net/firebird/extensions/#livehttpheaders[/url]
>
> Very cool for web app developers...
a lot. Thanks.
--
Andrew Gaffney
System Administrator
Skyline Aeronautics, LLC.
776 North Bell Avenue
Chesterfield, MO 63005
636-357-1548
Andrew Gaffney Guest



Reply With Quote

