eg: waitFor order confirmation to be attached instead of visible, #233

This commit is contained in:
Ralf Vogler 2023-10-13 00:03:11 +02:00
parent ad2301c3fd
commit 04787909c7

View file

@ -227,7 +227,7 @@ try {
// console.info(' Saved a screenshot of hcaptcha challenge to', p); // console.info(' Saved a screenshot of hcaptcha challenge to', p);
// console.error(' Got hcaptcha challenge. To avoid it, get a link from https://www.hcaptcha.com/accessibility'); // TODO save this link in config and visit it daily to set accessibility cookie to avoid captcha challenge? // console.error(' Got hcaptcha challenge. To avoid it, get a link from https://www.hcaptcha.com/accessibility'); // TODO save this link in config and visit it daily to set accessibility cookie to avoid captcha challenge?
}).catch(_ => { }); // may time out if not shown }).catch(_ => { }); // may time out if not shown
await page.waitForSelector('text=Thanks for your order!'); await page.locator('text=Thanks for your order!').waitFor({state: 'attached'});
db.data[user][game_id].status = 'claimed'; db.data[user][game_id].status = 'claimed';
db.data[user][game_id].time = datetime(); // claimed time overwrites failed/dryrun time db.data[user][game_id].time = datetime(); // claimed time overwrites failed/dryrun time
console.log(' Claimed successfully!'); console.log(' Claimed successfully!');