GithubHelp home page GithubHelp logo

Comments (4)

QIN2DIM avatar QIN2DIM commented on May 25, 2024 1

The interesting thing is that the first time I ran it it was fine, and from the second run onwards it kept throwing this exception.

Video_20220421215110_.mp4

from free-games-claimer.

jackblk avatar jackblk commented on May 25, 2024 1

Quick fix:

 if (await page.locator('button:has-text("Continue")').count() > 0) { 
   console.log('This game contains mature content recommended only for ages 18+'); 
   await page.click('button:has-text("Continue")'); 
 } 

from free-games-claimer.

vogler avatar vogler commented on May 25, 2024

I just ran it and it claimed both games successfully:

$ node epic-games
userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36
Not signed in anymore. Please login and then navigate to the 'Free Games' page.
Signed in.
Number of free games: 2
Current free game: Insurmountable
Not in library yet! Click GET.
Claimed successfully!
Current free game: XCOM® 2
Not in library yet! Click GET.
Claimed successfully!

I didn't get the message about mature content, but the code at this point only checks for a button with 'Continue':

if (await page.locator(':has-text("Continue")').count() > 0) {
console.log('This game contains mature content recommended only for ages 18+');
await page.click('button:has-text("Continue")');
}

So I assume in your case, it first counted > 0 for a button with 'Continue', but then when it wanted to click on it, the button was no longer there, or not in view.
Can you make a video what happens or run it with PWDEBUG=1 node epic-games and step through it?
I assume it's either some race condition or a EU vs. non-EU difference.

from free-games-claimer.

vogler avatar vogler commented on May 25, 2024

Thanks, it should have been like this from the start. It just found the word Continue on the page and then tried to click the non-existing button.

from free-games-claimer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.