From 30b1835bdbf850eae389a0010945ca607cf61f6a Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sun, 23 Jun 2024 19:16:01 +0200 Subject: [PATCH] pg: reverse games: oldest/bottom to newest/top --- prime-gaming.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prime-gaming.js b/prime-gaming.js index b555f67..ca3fcee 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -107,6 +107,9 @@ try { // can't use .all() since the list of elements via locator will change after click while we iterate over it const internal = await games.locator('.item-card__action:has([data-a-target="FGWPOffer"])').elementHandles(); const external = await games.locator('.item-card__action:has([data-a-target="ExternalOfferClaim"])').all(); + // bottom to top: oldest to newest games + internal.reverse(); + external.reverse(); console.log('Number of free unclaimed games (Prime Gaming):', internal.length); // claim games in internal store for (const card of internal) {