* dealing with case that filters deliver no results

This commit is contained in:
4n4n4s 2023-10-03 18:25:14 +00:00
parent b4bec61b4f
commit 1e9495c777

7
gog.js
View file

@ -266,9 +266,12 @@ async function claimFreegames(){
for (const url of gameUrls) { for (const url of gameUrls) {
allLinks.push(url); allLinks.push(url);
} }
if (await page.locator('.small-pagination__item--next.disabled').isVisible()){ if (await page.locator('.catalog__empty').isVisible()){
hasMorePages = false; 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 { } else {
await page.locator(".small-pagination__item--next").first().click(); await page.locator(".small-pagination__item--next").first().click();
console.log("next page - waiting"); console.log("next page - waiting");