Skip to content

Instantly share code, notes, and snippets.

@mpgarate
Last active March 24, 2022 19:13
Show Gist options
  • Save mpgarate/6348e6dbc1d1985526ac9e20f2b2efa1 to your computer and use it in GitHub Desktop.
Save mpgarate/6348e6dbc1d1985526ac9e20f2b2efa1 to your computer and use it in GitHub Desktop.
// 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