Last active
March 24, 2022 19:13
-
-
Save mpgarate/6348e6dbc1d1985526ac9e20f2b2efa1 to your computer and use it in GitHub Desktop.
This file contains 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
// https://global.americanexpress.com/offers/eligible | |
function main() { | |
bs = Array.from(document.getElementsByClassName('offer-cta')).filter(button => button.getAttribute("title") == "Add to Card"); | |
if (bs.length > 0) { | |
b = bs.shift(); | |
console.log(b.getAttribute('title')); | |
b.click(); | |
} | |
if (bs.length > 1) { | |
console.log(bs.length); | |
setTimeout(main, (4000)); | |
} | |
}; | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment