From 6c190c1f602fd74e0d4c3c8a5824f03ea26dffaf Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 16 Jun 2022 16:18:45 +0200 Subject: [PATCH] epic-games changed OfferCard selector -> just click `a` with the right text --- epic-games.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index 2a5f9e5..a6a406f 100644 --- a/epic-games.js +++ b/epic-games.js @@ -47,7 +47,7 @@ while (await page.locator('a[role="button"]:has-text("Sign In")').count() > 0) { } console.log('Signed in.'); // click on each banner with 'Free Now'. TODO just extract the URLs and go to them in the loop -const game_sel = 'div[data-component="OfferCard"]:has-text("Free Now")'; +const game_sel = 'a:has-text("Free Now")'; await page.waitForSelector(game_sel); // const games = await page.$$(game_sel); // 'Element is not attached to the DOM' after navigation; had `for (const game of games) { await game.click(); ... } const n = await page.locator(game_sel).count();