From 2ae513f6c0cfc95e038e2a7ee3625b0f4e4710c8 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 14 Jul 2022 16:49:03 +0200 Subject: [PATCH] epic-games: save data/screenshots/epic-games/title.png for each game, not fullPage --- epic-games.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epic-games.js b/epic-games.js index daa0699..ff22708 100644 --- a/epic-games.js +++ b/epic-games.js @@ -73,6 +73,8 @@ try { await page.click('button:has-text("Continue")'); } const btnText = await page.locator('//button[@data-testid="purchase-cta-button"][not(contains(.,"Loading"))]').first().innerText(); + const p = path.resolve(dirs.screenshots, 'epic-games', `${title.replace(/[^a-z0-9]/gi, '_')}.png`); + await page.screenshot({ path: p, fullPage: false }); // fullPage is quite long... if (btnText.toLowerCase() == 'in library') { console.log('Already in library! Nothing to claim.'); } else {