Skip to content

Instantly share code, notes, and snippets.

@elkhadiy
Last active August 29, 2015 14:06
Show Gist options
  • Save elkhadiy/1d9cf954825b6dabb5c5 to your computer and use it in GitHub Desktop.
Save elkhadiy/1d9cf954825b6dabb5c5 to your computer and use it in GitHub Desktop.
Get total amount of an amazon wish list for yurop people
var list = $$('span.a-color-price.a-size-base');
var total = 0;
for (i = 0; i < list.length; i++) {
var price = parseFloat(list[i].innerHTML.replace('EUR', '') .replace(',', '.'));
total += price;
}
console.log("Total amount of items in wish list = ", total, "€");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment