Skip to content

Instantly share code, notes, and snippets.

@dasblitz
Last active November 25, 2016 15:49
Show Gist options
  • Save dasblitz/53b35cf813f3aa9612ad5b2010d60f92 to your computer and use it in GitHub Desktop.
Save dasblitz/53b35cf813f3aa9612ad5b2010d60f92 to your computer and use it in GitHub Desktop.
Very naïve script to log Rabobank transactions comma separated so you can import it into an excel. (Chrome only)
// DISCLAIMER: this script can and probably will break as soon as the Rabobank decides to change their website
// I won't maintain this in any way
// currently only logs:
// AccountNumber, transactionDate (not interestDate), debit or credit, amount, beneficiaryBank, beneficiaryName and description
// The reason I wrote this is because the Rabobank export function doesn't let you export this data if it's older than 1.5 years.
// If you need older data, Rabobank can send you the paper version, and charges you about €5 for each month you need, with a maximum of €25,-
// However you can search and view older the transactions
// To use: On rabointernetbankieren go to advanced search, select a period and hit search
// keep scrolling down until the list isn't updating anymore (you have loaded all the data).
// copy paste this script in the browser console and hit 'Enter'
// copy the console output and save to a .txt file
// import the file in excel (make sure you select separated and choose 'comma' as separator)
accountNumber = document.querySelectorAll('.account_selected .as_number').length ? document.querySelectorAll('.account_selected .as_number')[0].innerText.replace(/ /g,'') : `""`;
rowsFormatted = Array.from(document.querySelectorAll('.table_a tr')).map(item => {
const dateSplit = item.querySelectorAll('.date')[0].innerHTML.replace('<span class="vi_eachtxn_date">', '-').replace('</span>', '').split('-');
const date = dateSplit[2]+dateSplit[1]+dateSplit[0];
const debit = (item.classList.contains('debit') > -1) ? 'D' : 'C';
const amount = item.querySelectorAll('.amount')[0].innerHTML.replace(',', '.');
const beneficiaryBank = item.querySelectorAll('.beneficiarydetails .accountnumber')[0].innerText || `""`;
const beneficiaryName = item.querySelectorAll('.beneficiarydetails .name').length ? item.querySelectorAll('.beneficiarydetails .name')[0].innerText : `""`;
const description = item.querySelectorAll('.description .description')[0].innerText;
return {
date,
debit,
amount,
beneficiaryBank,
beneficiaryName,
description
}
});
output = '';
rowsFormatted.reverse().forEach( item => {
output += `${accountNumber}, EUR, ${item.date}, ${item.debit}, ${item.amount}, ${item.beneficiaryBank}, ${item.beneficiaryName}, "", "", "", ${item.description}, "", "", "", "", "", "", "", ""
`;
});
console.log(output);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment