Hello All,
Need help creating a script that goes into a secure website, logs in using my credentials and then parses through the data looking for dates and dollar amounts and reports back in an email if the information was found.
Does anyone know which modules I can use to make this happen? Please advise.
I wrote a program that logs in to my old bank's online banking and grabs my balance and available balance. The following code should give you an idea of where to start.
#!/usr/bin/perl
use LWP::UserAgent; use HTTP::Cookies;
my $res, $req; my $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => "/tmp/bankcookies.txt", autosave => 1)); my $availbalance, $balance; my $username = "username"; my $password = "xxxxxxxx";
# Login $req = HTTP::Request->new(POST => 'https://pcbanking.umb.com/login.asp'); $req->content_type('application/x-www-form-urlencoded'); $req->content("pgUserId=${username}&pgPassword=${password}&pgValidationReq=1&pgWhichBrowser=IE&pgLogin=Login"); $res = $ua->request($req);
# Get Balances $req = HTTP::Request->new(GET => https://pcbanking.umb.com/Accountsummary.asp'); $res = $ua->request($req); $output = $res->as_string; $output =~ s/.+<div name = "DataLayer">(.+)<\/div>.+/$1/s; $output =~ /\$(\d+\.\d+).+\$(\d+\.\d+)</; $availbalance = $1; $balance = $2; $cmdoutput = "_\nAvail: ${availbalance}\nBalance: ${balance}";
It was pretty easy to login automatically to this site, but I can't do the same thing for my current bank or my credit card company (Capital One), because their login pages use Javascript to generate random values and set cookies that are needed to login. I could figure it out if I really wanted to, but it isn't that big of a deal for me.
-- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>