Success !!Connecting to online banking with wells fargo
Hill, Ronald (Ronald.Hill@ugs.com)
Wed, 11 Apr 2001 12:24:25 -0700
Hi All,
I would like to thank all of you for your help getting this to work!! I am
now able to download my account history!!
One question, is there a better way to do the refresh? As it stands now I
loose the info that I entered from the first step.
thanks !!
Ron Hill
#!/usr/bin/perl -w
use HTTP::Request::Common;
use HTML::Form;
use LWP::UserAgent;
#use LWP::Debug qw(+);
BEGIN {
*LWP::UserAgent::redirect_ok = sub {1}
}
use HTTP::Cookies;
use File::Basename;
use strict;
usage() unless (@ARGV);
my $cookie = 'c:\temp\cookie_jar.txt';
unlink $cookie;
my $final_req = '';
my $ua = LWP::UserAgent->new;
$ua->cookie_jar(
HTTP::Cookies->new(
file => "$cookie",
autosave => 1 )
);
my $savefile = 'c:/temp/checkingpage.txt';
$ua->agent('Mozilla/4.73');
my $req = $ua->request( POST 'https://banking.wellsfargo.com' );
my $form = HTML::Form->parse( $req->content, $req->base());
$form->value( 'userid', "$ARGV[0]" );
$form->value( 'password', "$ARGV[1]" );
$req = $ua->request( $form->click('Account Summary') );
if ( my $refresh = $req->header("Refresh") ) {
( undef, $final_req ) = split ( /=/, $req->header("Refresh") );
$req =
$ua->request( POST $final_req,
{ 'Account Summary' => 'Account Summary' } );
}
$form = HTML::Form->parse( $req->content, $req->base() );
$form->value( 'selectedFn', 'EXEC_DOWNLOAD' );
$req = $ua->request( $form->make_request );
my @forms = HTML::Form->parse( $req->content, $req->base() );
$forms[1]->value( 'acctindex', '0' );
$forms[1]->value( 'fileformat', "5" );
$req = $ua->request( $forms[1]->click('IT_Multi1') );
@forms = HTML::Form->parse( $req->content, $req->base() );
$forms[1]->value( 'fileformat', "5" );
$req = $ua->request( $forms[1]->click('IT_Multi3'), $savefile );
sub usage() {
my $file = basename $0;
print <<END_USAGE;
Usage:
\$ $file <option>
where <option> is [ID,password].
END_USAGE
exit 0;
} # sub usage()