WezM.net The weblog of Wesley Moore

18Jul/091

Scraping NAB Internet Banking with Mechanize

This week I wanted to write a script that would get my account balances from nab Internet Banking. These types of things are generally quite simple with Ruby and Mechanize. I got the basics of the script up and running fairly quickly but when I ran it the site always rejected my username and password.

After a lot more time in the Safari Web Inspector I finally worked out that the site actually expects the password submitted to the login page to be ‘mixed’ with a key that is unique for each page load. The ‘mixing’ (for lack of a better description) is performed by a javascript function. After I reimplemented this function in my Ruby script I was then able to sucessfully login and retrieve my account balances. My code is supplied below for anyone else who is wanting to do something like this.

Related Posts

Comments (1) Trackbacks (0)
  1. Hi there,

    How does one actually use your code… I can’t run it from the command line…


Leave a comment


No trackbacks yet.

Recent Comments

Categories

Links

Archives

Tags

adaptive atom awk bash benchmark books cake consolas core-audio debian decoder delivery expand feed font fonts git glob gripe installer iPhone ipod Linux mad melbourne microsoft mp3 mpg123 music package pocket-reference rss ruby script sed shell smoothing snow-leopard textmate title tux UNIX uri-scheme variable virtualbox

Meta

Contact