From 04787909c7b83b842ebc605ee0ba9e51bca893cd Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Fri, 13 Oct 2023 00:03:11 +0200 Subject: [PATCH] eg: waitFor order confirmation to be attached instead of visible, #233 --- epic-games.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index 16984a3..78675e3 100644 --- a/epic-games.js +++ b/epic-games.js @@ -227,7 +227,7 @@ try { // 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? }).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].time = datetime(); // claimed time overwrites failed/dryrun time console.log(' Claimed successfully!');