Last active
November 22, 2020 11:04
-
-
Save mohanraj-r/92ad772ba63b37ee06315d1d20230eec to your computer and use it in GitHub Desktop.
Amazon order summary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Executed on "Your Account › Your Orders" page | |
// TODO: | |
// * replace console.log with actual summation | |
// * Pagination - navigate to all pages | |
const currency = "CDN" | |
const re = new RegExp('[0-9]+\.[0-9]+') | |
const list = document.getElementsByClassName("value") | |
for (let i of list) { | |
if(i.innerText.startsWith(currency)) { | |
console.log(i.innerText.match(re)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment