* dealing with case that filters deliver no results
This commit is contained in:
parent
b4bec61b4f
commit
1e9495c777
1 changed files with 5 additions and 2 deletions
7
gog.js
7
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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue