From 43c2df7e4a23b4ca151396b3ddd91326bbe50298 Mon Sep 17 00:00:00 2001 From: Trung Le Date: Fri, 27 May 2022 11:17:32 +0700 Subject: [PATCH] feat: improve Get button locator --- epic-games.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index fc972b9..51c5c45 100644 --- a/epic-games.js +++ b/epic-games.js @@ -67,7 +67,7 @@ for (let i = 1; i <= n; i++) { console.log('This game contains mature content recommended only for ages 18+'); await page.click('button:has-text("Continue")'); } - const btnText = await page.locator('[data-testid="purchase-cta-button"]').first().innerText(); + const btnText = await page.locator('//button[@data-testid="purchase-cta-button"][not(contains(.,"Loading"))]').first().innerText(); if (btnText.toLowerCase() == 'in library') { console.log('Already in library! Nothing to claim.'); } else {