3 ms·
i think this works for the Amex one. where do you run/test this? javascript:for (let b of document.querySelectorAll('.offer-cta[title="Add to Card"]')) {
by gabrielsroka 2y ago
i think this works for the Amex one. where do you run/test this?
javascript:for (let b of document.querySelectorAll('.offer-cta[title="Add to Card"]')) {
console.log("Clicking offer button");
b.click();
(async () => {await new Promise(r => setTimeout(r, 2e3))})();
}
does the setTimeout work? wouldn't you need something like this (in an async function)
for (let b of document.querySelectorAll('.offer-cta[title="Add to Card"]')) {
console.log('Clicking offer button');
b.click();
await new Promise(r => setTimeout(r, 2e3));
}
- ashconnor 2y agoI run it on the offers page https://global.americanexpress.com/offers/eligible https://global.americanexpress.com/offers/eligible The wrapped async function is for Firefox I understand.