[Israel.pm] downloading and managing bank account statements

Yuval Kogman nothingmuch at woobling.org
Tue Dec 20 08:30:09 PST 2005


On Tue, Dec 20, 2005 at 17:59:10 +0200, Ophir Yoktan wrote:

> Does anyone know a good enough web automation module (that is - one
> that will work also with the banks sites - which have non standard web
> pages)
> and a module that can produce easily quicken files (.QFX)?

WWW::Mechanize wraps around LWP::UserAgent, which can handle SSL if
the necessary modules are installed (Net::SSLeay, I think...
anyone?).

This means that you can connect, and fetch URIs.

As for the nonstandard interface bit - I bet you mean the javascript
mess ;-)

You should just do the stuff in the web browser, and then just go
directly to the form that submits to the result generator, and use
WWW::Mechanize with that directly, instead of navigating like a real
user.

This will probably let you do what you want.

Next you need to extract the data. Till banks have JSON feeds I
doubt this will be very robust, since their APIs are subject to
change, but a module that will help you get this done is
HTML::TableExtractor, which will make the arrangement of the right
element callbacks easier.

At this point I would stop, and write all the data to a database.

In fact, release your code as a module - look at all the other
Finance::Bank modules, and try to make Finance::Bank::IL::Leumi ;-)

Then you can use Finance::QIF (is that what you wanted) to move from
the database to Quicken. I didn't find anything else, sorry. You
might want to consider using GnuCash, which is opensource, pretty
nice, and probably more scriptable.

For advice look at WWW::Mecahanize::FAQ, and WWW::Mechanize::Examples.

The WWW::Mechanize flow should basically look like this

	my $mech = WWW::Mechanize->new;

	$mech->get( 'https://yourbank.com/login_page' );

	$mech->submit_form(
		form_number => $x,
		fields => {
			login => ...,
			password => ...,
		},
	);

	# now you're logged in, and you should have a cookie

	$mech->get( 'https://yourbank.com/report_generator' );

	my $result = $mech->submit_form( ... );

	my $html = $result->contents;

	...


-- 
 ()  Yuval Kogman <nothingmuch at woobling.org> 0xEBD27418  perl hacker &
 /\  kung foo master: MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM: neeyah!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://perl.org.il/pipermail/perl/attachments/20051220/253907c7/attachment.pgp 


More information about the Perl mailing list