Fix wait "FreeOfferCard"

This commit is contained in:
XEGARE 2022-05-19 21:24:44 +05:00
parent cb9aed2871
commit 8288f3dce9

View file

@ -53,7 +53,7 @@ while (await page.locator('a[role="button"]:has-text("Sign In")').count() > 0) {
}
console.log('Signed in.');
// click on each banner with 'Free Now'. TODO just extract the URLs and go to them in the loop
const game_sel = 'div[data-component="FreeOfferCard"]:has-text("Free Now")';
const game_sel = 'div[data-component="OfferCard"]:has-text("Free Now")';
await page.waitForSelector(game_sel);
// const games = await page.$$(game_sel); // 'Element is not attached to the DOM' after navigation; had `for (const game of games) { await game.click(); ... }
const n = await page.locator(game_sel).count();