From 1e9495c77723c4e61091dd788b66b125cb368023 Mon Sep 17 00:00:00 2001 From: 4n4n4s Date: Tue, 3 Oct 2023 18:25:14 +0000 Subject: [PATCH] * dealing with case that filters deliver no results --- gog.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gog.js b/gog.js index 91bd1717..82379f65 100644 --- a/gog.js +++ b/gog.js @@ -266,9 +266,12 @@ async function claimFreegames(){ for (const url of gameUrls) { allLinks.push(url); } - if (await page.locator('.small-pagination__item--next.disabled').isVisible()){ + if (await page.locator('.catalog__empty').isVisible()){ hasMorePages = false; - console.log("last page"); + console.log("no games could be found with your filter"); + } else if (await page.locator('.small-pagination__item--next.disabled').isVisible()){ + hasMorePages = false; + console.log("last page reached"); } else { await page.locator(".small-pagination__item--next").first().click(); console.log("next page - waiting");