Automatic Bank Balance Checking at WaMu
This requires WWW::Mechanize, but it works quite well.
require 'rubygems' require 'mechanize' agent = WWW::Mechanize.new # login to the account puts "Login" page = agent.get('https://online.wamu.com/IdentityManagement/Logon.aspx') login_form = page.forms.with.name("frmLogin").first login_form.txtUserID = '<UNAME>' login_form.password = '<PWD>' page = agent.submit(login_form, login_form.buttons.first) # click on the download button puts "Download" dl_link = page.links.with.text(/WAMU FREE CHECKING/) page = agent.click(dl_link) line_items = [] trs = (page/"table#_ctl0_depositTransactionsGrid/tr") trs.shift trs.each do |tr| tds = (tr/:td) dtd = tds[1].inner_html js_call = dtd.match(/showDDATransactionDetails\('(.*)'\);/)[1] js_fields = js_call.split("','") item = {} item['type'] = js_fields[1] item['descr'] = js_fields[3] item['amount'] = js_fields[4] item['tranid'] = js_fields[6] # if !tranid = ovedraft charge / bank fee item['date'] = tds[0].inner_html item['debit'] = tds[3].inner_html item['credit'] = tds[4].inner_html item['balance'] = tds[5].inner_html line_items << item end pp line_items.first