/cua-scrape

Selenium scripts for getting transaction history CSV exports out of Great Southern Bank's web UI (previously Credit Union Australia)

Primary LanguageJupyter Notebook

Great Southern Bank, formerly known as Credit Union Australia, is one of the biggest member-owned banks / credit unions in Australia. Unfortunately, the only way it seems possible to get usable data files with account and transaction information out of their system is to use their web banking user interface. It has a bunch of protections in it to prevent links on any page working beyond the single render of that page at that point in time, and also uses a whole bunch of iframes that's a bit gross. But anyway. In search of a more reliable way to get this data for myself in a more automated manner (and without poking proprietary banking APIs that might lock me out of my own accounts), I sat down and worked out a whole bunch of Selenium commands that will click the right buttons to trigger the UI in the way required to:

  • choose the account to export (i.e. go to its transaction history page)
  • choose the "6 months" transaction history window, the widest one GSB/CUA seems to offer
  • click the right export button in the right dropdown of the UI to kick off the CSV export

Setup + Usage instructions

  • Install Jupyter Notebook
  • Instal Ruby and the selenium-webdriver gem. I developed this notebook on Ubuntu 20.04's system Ruby 2.7 and ruby-selenium-webdriver APT package which is apparently version 3.142.7.
  • Install the IRuby kernel - gem install --user-install iruby (see the IRuby GitHub for reference)
  • Run the notebook cell-by-cell. You will see an instance of Firefox start up on your computer that you can follow all the actions in. The notebook code contains prompts for entering your login credentials and choosing the accounts to trigger an export for.

TODO

  • Detect when the CSV export's download is complete and/or in-progress
  • Grab and rename the downloaded files to include account details.
    • GSB/CUA serve up the CSV export files with the annoyingly generic filename of <your_account_id>_<current_date>.csv. This doesn't tell you what account the export came from.
    • Reliably finding the created file might be a challenge - filesystem event APIs? continuous polling of the directory? Ideally the filename could just be pulled out of Firefox itself - this would require the same kind of infrastructure as detailled above though.
  • Turn this into some kind of proper script that can be fed credentials in a secure manner so it can be called from cron or something like that, so I can stop ending up with gaps in my copies of my transaction history when I forget to run an export for more then 6 months.