Merge pull request #274 from Primajin/#208-prime-gaming
Use `.tw-button` css class over `button` html element selector
This commit is contained in:
commit
e078a1540a
1 changed files with 4 additions and 4 deletions
|
|
@ -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');
|
||||
|
|
@ -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?
|
||||
|
|
@ -349,12 +349,12 @@ try {
|
|||
await page.goto(url, { waitUntil: 'domcontentloaded' });
|
||||
// most games have a button 'Get in-game content'
|
||||
// epic-games: Fall Guys: Claim -> Continue -> Go to Epic Games (despite account linked and logged into epic-games) -> not tied to account but via some cookie?
|
||||
await Promise.any([page.click('button:has-text("Get in-game content")'), page.click('button:has-text("Claim your gift")'), page.click('button:has-text("Claim")').then(() => page.click('button:has-text("Continue")'))]);
|
||||
await Promise.any([page.click('.tw-button:has-text("Get in-game content")'), page.click('.tw-button:has-text("Claim your gift")'), page.click('.tw-button:has-text("Claim")').then(() => page.click('button:has-text("Continue")'))]);
|
||||
page.click('button:has-text("Continue")').catch(_ => { });
|
||||
const linkAccountButton = page.locator('[data-a-target="LinkAccountButton"]');
|
||||
let unlinked_store;
|
||||
if (await linkAccountButton.count()) {
|
||||
unlinked_store = await linkAccountButton.getAttribute('aria-label');
|
||||
unlinked_store = await linkAccountButton.first().getAttribute('aria-label');
|
||||
console.debug(' LinkAccountButton label:', unlinked_store);
|
||||
const match = unlinked_store.match(/Link (.*) account/);
|
||||
if (match && match.length == 2) unlinked_store = match[1];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue