If you wanted to re-write that for Chrome or whatever (including headless) I would suggest Selenium or WebDriver suite, including PhantomJS. However, my knowledge (expert level at the time) is a bit outdated and there are probably new toolkits based on the Selenium/WebDriver protocol, it is a good direction to point you to.
I have had my bank remove records from my online account, or not have the ledger balance add up, so your idea interest me. I contacted the controller of the currency about my bank messing with my records, and they did absolutely nothing.