get account balances from bank Web site?

Franco Saliola saliola-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Sat Jul 16 15:33:56 UTC 2005


Hello,

On 7/16/05, Dan Barkwell <dbarkwell-05pvsIyEU8vQT0dZR+AlfA at public.gmane.org> wrote:
> http://www.perl.com/pub/a/2003/01/22/mechanize.html
> 
> WWW::Mechanize is a great Perl module to use in this instance.

I second this! This was exactly what came to mind. And it is not
difficult to use. "man WWW::Mechanize" gives enough information to use
it. The following script should get you logged in and print the first
page you see once logged in.

Before running the script with your cardnumber and password, check
that the URL is the correct one. You shouldn't trust me.

Franco

--

#!/usr/bin/perl

use strict;
use warnings;
use WWW::Mechanize;

#####
# You will need libcrypt-ssleay-perl as well.
# WWW::Mechanize will tell you what you are missing, if anything.

 #####
 # login information

my $cardnumber='1234567890';
my $password='********';

 #####
 # create a new user agent and request the webpage
 #
 # I got this url from clicking go on www.pcfinancial.ca
 # and looking at the address bar of the resulting page.

my $mech = WWW::Mechanize->new();
$mech->get('https://www.txn.banking.pcfinancial.ca/ams/PreSignon.ams');

 #####
 # Log in
 #
 # I got the form information using Firefox's "View Page Info".
 # It gave the name of the form and the name of the fields.

$mech->submit_form(
 form_name => 'SignonForm',
 fields => {
  cardNumber => $cardnumber,
  password => $password 
 }
);

 #####
 # Navigate to the field you want

#$mech->click_button( value => "...balances....");
#$mech->follow_link( text => "...balances...");

 #####
 # The page sourcecode will be contained in $mech->content;

print $mech->content;

--
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list