Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turnstile completion callback, and waitforselector error in 1.3.0 version #136

Open
CarbonPool opened this issue Aug 24, 2024 · 11 comments
Open

Comments

@CarbonPool
Copy link

How do I know the callback of the completed turnstile action? I use page.waitforselector to check. Unfortunately, after the 1.3.0 update, waitforselector cannot query the element of the page where the turnstile has completed the redirection, and always times out. Here is a demo:

await page.goto('<turnstile_url>'); await page.waitForSelector('<app_id>', { timeout: 30000 })

@mdervisaygan
Copy link
Member

@mdervisaygan
Copy link
Member

I also had problems with waitForSelector, I will find a solution for this.

@mdervisaygan
Copy link
Member

Hi, this issue has been resolved with the upgrade of rebrowser to puppeteer-core. If the problem persists, please report it here.

@meotimdihia
Copy link

meotimdihia commented Oct 2, 2024

@zfcsoftware It didn't work for many sites. For the example:

import { connect } from "puppeteer-real-browser"

async function main() {
  const path = "/tmp/puppeteer-real-browser/"
    const url = "https://ezmanga.org/series/92ae7351c3e"
    console.log(" --- " + url)
    const selector = "#chapters a.group"
     const { browser, page } = await connect({
    headless: false,
    customConfig: {
      userDataDir: path
    },
    args: [],
    turnstile: true,
    connectOption: {},
  })
  await page.goto(url)
    await page.waitForSelector(selector)
  await browser.close()
}

main()
  .catch(console.error)
  .finally(async () => {
    console.log("Done")
  })

TimeoutError: Waiting for selector #chapters a.group failed: Waiting failed: 30000ms exceeded

puppeteer-real-browser: ^1.3.16

@meotimdihia
Copy link

@zfcsoftware I tagged you in case, you forgot to recheck this issue. Please re-open this problem.

@mdervisaygan
Copy link
Member

@zfcsoftware I tagged you in case, you forgot to recheck this issue. Please re-open this problem.

I didn't have any problems, but I will add an additional function called page.waitForSelectorPatch for those who have problems.

@mdervisaygan mdervisaygan reopened this Oct 5, 2024
@meotimdihia
Copy link

@zfcsoftware did you test the problem on Windows only? I have this problem on both macOS and Ubuntu.

@alextran317
Copy link

@zfcsoftware I tagged you in case, you forgot to recheck this issue. Please re-open this problem.

I didn't have any problems, but I will add an additional function called page.waitForSelectorPatch for those who have problems.

@zfcsoftware Please add function waitForSelectorPatch. Thank you very much.

@jmucke
Copy link

jmucke commented Dec 1, 2024

For me, the issue occurred with version 1.3.18. However, 1.3.17 works fine. Maybe try downgrading.

I didn't have problems with page.waitForSelector, but with page.evaluate. Where page.evaluate was executed on the "wrong page". I noticed, because the window object, when accessed via the dev tools in the browser, was different from the window object in puppeteer. Sounds like a bug on my side, I know, but the same exact code does not have this issue with the older version.

@Kosmonaft
Copy link

I tried with 1.3.17 and 1.3.22
Sadly no luck.
waitForSelector and waitForNavigation are Timeout always :-(

Funny enough, when I wrapped each wait*** with try catch, after the timeout error is logged it continue executing (until the next wait***

@RubberArchind
Copy link

RubberArchind commented Jan 19, 2025

I tried with 1.3.17 and 1.3.22 Sadly no luck. waitForSelector and waitForNavigation are Timeout always :-(

Funny enough, when I wrapped each wait*** with try catch, after the timeout error is logged it continue executing (until the next wait***

that was expected behaviour when you wrap each of them with try catch.

and for the issue, maybe you can try to do checking inside page.evaluate with JS for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants