From 1b7632d641e30f9c3e9205c872eb909ca7ac4b33 Mon Sep 17 00:00:00 2001 From: XEGARE Date: Sat, 12 Feb 2022 12:44:53 +0500 Subject: [PATCH] Fixed waiting for "I agree" button --- epic-games.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index 4e3b395..758770b 100644 --- a/epic-games.js +++ b/epic-games.js @@ -112,7 +112,7 @@ const TIMEOUT = 20 * 1000; // 20s, default is 30s const iframe = page.frameLocator('#webPurchaseContainer iframe') await iframe.locator('button:has-text("Place Order")').click(); // await page.pause(); - // await iframe.locator('button:has-text("I Agree")').click(); + await Promise.any(['button:has-text("I Agree")', '#webPurchaseContainer iframe'].map(s => page.click(s))); // This is true even when there is no captcha challenge shown! That was the reason why old.stealth.js worked - it did not have this check... TODO check for hcaptcha // if (await iframe.frameLocator('#talon_frame_checkout_free_prod').locator('text=Please complete a security check to continue').count() > 0) { // console.error('Encountered hcaptcha. Giving up :(');