Skip to content

Instantly share code, notes, and snippets.

@beatak
Created July 27, 2020 23:26
Show Gist options
  • Save beatak/b4647fd815ea115e408a2d3e2f5e9ce2 to your computer and use it in GitHub Desktop.
Save beatak/b4647fd815ea115e408a2d3e2f5e9ce2 to your computer and use it in GitHub Desktop.
amounts = [];
thetable = document.getElementsByTagName('tbody').item(0)
for (item of thetable.getElementsByTagName('tr')) {
const mytd = item.getElementsByTagName('td').item(3);
const mysize = parseFloat(mytd.textContent.split(' ')[0]);
amounts.push(mysize);
}
amounts.reduce((accum, cur) => { return accum + cur; }, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment