Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Before proceeding add an ID `target` to the table you want to perform the analysis on
- // Google Chrome intercepts $ as a shortcut for document.querySelector() and
- // $$() as a shortcut for document.querySelectorAll()
- items = []
- $$('#target tr').forEach(
- (row) => items.push(
- parseFloat(
- $$('td p font', row)[3].innerHTML.replace(/,/g, '.'))
- )
- )
- // remove header
- items = items.slice(1)
- // average it out
- items.reduce((a, b) => a + b) / items.length
Add Comment
Please, Sign In to add comment