Skip to content

Instantly share code, notes, and snippets.

@Glidias
Last active October 24, 2025 06:59
Show Gist options
  • Save Glidias/5f23b7ba8e41193b44595f01e9a51dfd to your computer and use it in GitHub Desktop.
Save Glidias/5f23b7ba8e41193b44595f01e9a51dfd to your computer and use it in GitHub Desktop.
Track Credit card spent in OCBC Personal Banking website
Array.from(document.querySelector(".MuiTable-root").querySelectorAll(".TableBody tr")).reduce((accum, r) => {let c = parseFloat(r.querySelector("td:nth-child(3)").textContent.trim()); accum += !isNaN(c) ? c : 0; return accum}, 0)
@Glidias
Copy link
Author

Glidias commented Oct 24, 2025

Right click, inspect element of any area containing the display table within OCBC personal banking website containing listed transactions for the entire month under a credit card statement account (to focus in the correct frame), and copy and paste this code to the Developer console tab and hit ENTER into the console commandline, to get your total credit card spent!

This 1-liner is basically a Array.reduce function to get the sum of all displayed numerically-parsable values shown in the 3rd <td> column per row in the table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment