Skip to content

Instantly share code, notes, and snippets.

@carpogoryanin
Created April 3, 2022 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carpogoryanin/4092a7ac191bc2b223316300c6b521fb to your computer and use it in GitHub Desktop.
Save carpogoryanin/4092a7ac191bc2b223316300c6b521fb to your computer and use it in GitHub Desktop.
VakifBank - Spent money
/*
How to check spent money in VakifBank for any period.
1. Go to: https://subesiz.vakifbank.com.tr/bireysel/en/area/hesaplar/vadesiz
2. Select Time Range (e.g. last 7 days)
3. Select Transaction type: Money outflows (to exclude income)
4. Run script below in Browser Console
*/
var sum = 0;
var elements = document.querySelectorAll(".account-detail-table td:nth-child(3) .money");
elements.forEach(element => {
var transaction = element.textContent.replace(' TL','').replace(' ','').replace('-','').replace('.','').replace(',','.')*1;
if (!!transaction) {
console.log(transaction, element.textContent);
sum += transaction;
} else {
console.log("wrong element:", element.textContent);
}
});
console.log('Total spent:', sum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment