Skip to content

Instantly share code, notes, and snippets.

@ferhatbostanci
Last active December 8, 2022 20:40
Show Gist options
  • Save ferhatbostanci/0f0955498339b2d864a7599326ae1f0a to your computer and use it in GitHub Desktop.
Save ferhatbostanci/0f0955498339b2d864a7599326ae1f0a to your computer and use it in GitHub Desktop.
let currency = '';
let totalBalance = 0;
let divCount = document.querySelector("#iframeBody > div.b3id-timeline-view.b3-timeline-view > div > div").children.length;
for (let i = 3; i <= divCount; i++){
const element = document.querySelector("#iframeBody > div.b3id-timeline-view.b3-timeline-view > div > div > div:nth-child(" + i + ")").querySelector("div > div.b3id-header-container.b3-header-container > div > div.b3-card-header-collapsed-content > div > div.b3-card-header-subtitle");
const text = element.textContent.split(' ').pop().replace(/\u00a0/g, ' ').split(' ');
const balance = Number(text[1]);
totalBalance += balance;
currency = text[0];
}
`${currency} ${totalBalance}`;
@BatuhanGoktaas
Copy link

This is amazing bro!!

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