From a707acf1b887e0d13a13e813bf5094e0a62bebf4 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 31 Mar 2022 19:43:07 +0200 Subject: [PATCH] prime-gaming: click Games since now only placeholders until in view --- prime-gaming.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prime-gaming.js b/prime-gaming.js index 8a5801a..13677ef 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -49,6 +49,7 @@ while (await page.locator('button:has-text("Sign in")').count() > 0) { if (!debug) context.setDefaultTimeout(TIMEOUT); } console.log('Signed in.'); +await page.click('button:has-text("Games")'); await page.waitForSelector('div[data-a-target="offer-list-FGWP_FULL"]'); console.log('Number of already claimed games (total):', await page.locator('div[data-a-target="offer-list-FGWP_FULL"] p:has-text("Claimed")').count()); const game_sel = 'div[data-a-target="offer-list-FGWP_FULL"] .offer__action:has-text("Claim game")'; @@ -74,7 +75,7 @@ for (const card of games) { if (!card) break; const title = await (await card.$('h3')).innerText(); console.log('Current free game:', title); - await (await card.$('button')).click(); + await (await card.$('text=Claim')).click(); // await page.waitForNavigation(); await page.click('button:has-text("Claim now")'); // TODO only Origin shows a key, check for 'Claimed' or code