Skip to content

Instantly share code, notes, and snippets.

@niklasschroetler
Created April 24, 2019 21:06
Show Gist options
  • Save niklasschroetler/49367649f390ea514731c342bac41327 to your computer and use it in GitHub Desktop.
Save niklasschroetler/49367649f390ea514731c342bac41327 to your computer and use it in GitHub Desktop.
Paste this script into the console of an Amazon List view or add it to a plugin like cjs to get the sum of all items in the list
var a = document.querySelectorAll(".a-price-whole");
var f = document.querySelectorAll(".a-price-fraction");
var s = 0;
for (var i = 0; i < a.length; i++) {
s = parseInt(a[i].innerText.substring(0, a[i].innerText.length - 1)) + s;
s = (parseInt(f[i].innerText) / 100) + s
}
console.log("Your List Price: " + s + " Euro");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment