Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found a fix on Reddit #8

Open
AirHeadsbuirse opened this issue Aug 6, 2022 · 1 comment
Open

Found a fix on Reddit #8

AirHeadsbuirse opened this issue Aug 6, 2022 · 1 comment

Comments

@AirHeadsbuirse
Copy link

// Find all the "Add to Card" buttons on the page
var offerButtons = Array.from(document.getElementsByClassName("offer-cta axp-offers__global__fluid___15Bk5 css-1duq00z")).filter(btn => btn.title == "Add to Card");
var index;
for (index = 0; index < offerButtons.length; ++index) {
console.log("Clicking offer button");
offerButtons[index].click();
// Wait 2seconds to be nice to AMEX servers :)
await new Promise(r => setTimeout(r, 2000));
}

https://www.reddit.com/r/amex/comments/nrlmbs/mostly_automated_way_to_add_all_offers/

@cjangrist
Copy link

var offerButtons = Array.from(document.getElementsByClassName("offer-cta")).filter(btn => btn.title == "Add to Card");
var index;
for (index = 0; index < offerButtons.length; ++index) {
    console.log("Clicking offer button");
    offerButtons[index].click();
    await new Promise(r => setTimeout(r, 1000));
}

worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants