Skip to content

Commit

Permalink
use tw-button css class over button html element selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Primajin authored Dec 22, 2023
1 parent 9f97805 commit e06ad3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prime-gaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ try {
console.log('Current free game:', title);
if (cfg.dryrun) continue;
if (cfg.interactive && !await confirm()) continue;
await (await card.$('button:has-text("Claim")')).click();
await (await card.$('.tw-button:has-text("Claim")')).click();
db.data[user][title] ||= { title, time: datetime(), store: 'internal' };
notify_games.push({ title, status: 'claimed', url: URL_CLAIM });
// const img = await (await card.$('img.tw-image')).getAttribute('src');
Expand All @@ -137,7 +137,7 @@ try {
if (cfg.debug) await page.pause();
if (cfg.dryrun) continue;
if (cfg.interactive && !await confirm()) continue;
await Promise.any([page.click('button:has-text("Get game")'), page.click('button:has-text("Claim")'), page.click('button:has-text("Complete Claim")'), page.waitForSelector('div:has-text("Link game account")'), page.waitForSelector('.thank-you-title:has-text("Success")')]); // waits for navigation
await Promise.any([page.click('.tw-button:has-text("Get game")'), page.click('.tw-button:has-text("Claim")'), page.click('.tw-button:has-text("Complete Claim")'), page.waitForSelector('div:has-text("Link game account")'), page.waitForSelector('.thank-you-title:has-text("Success")')]); // waits for navigation

// TODO would be simpler than the below, but will block for linked stores without code
// const redeem_text = await page.textContent('text=/ code on /'); // FAQ: How do I redeem my code?
Expand Down

0 comments on commit e06ad3a

Please sign in to comment.