From 21c13ad4d6dcb5cb21384bdd82ba220a5cc3e7fd Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 21 Apr 2022 20:36:35 +0200 Subject: [PATCH] fix #14 `count` and `click` should use the same (button) locator --- epic-games.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index 1c9e975..dd6569b 100644 --- a/epic-games.js +++ b/epic-games.js @@ -62,7 +62,7 @@ for (let i = 1; i <= n; i++) { const title = await page.locator('h1 div').first().innerText(); console.log('Current free game:', title); // click Continue if 'This game contains mature content recommended only for ages 18+' - if (await page.locator(':has-text("Continue")').count() > 0) { + if (await page.locator('button:has-text("Continue")').count() > 0) { console.log('This game contains mature content recommended only for ages 18+'); await page.click('button:has-text("Continue")'); }