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

playwright stealth + persistent context #11

Open
codeman5000 opened this issue Mar 11, 2022 · 4 comments
Open

playwright stealth + persistent context #11

codeman5000 opened this issue Mar 11, 2022 · 4 comments

Comments

@codeman5000
Copy link

hello,

i would like my browser to be undetectable for anti bot systems and this works if i use a chromium browser with chrome channel in stealth mode.
however i would like my cookies and user data to be saved to reuse for next session.

so i launch my chrome with

browsers[i] = await p.chromium.launch_persistent_context(c.folderpath_userdata + "\user" + str(i) + "\", channel="chrome", headless=False)
page[i] = await browsers[i].new_page()
await stealth_async(page[i])

however as soon as i use the persistent context i get a bot detecton webdriver on https://bot.sannysoft.com/

xx

@bakibillah
Copy link

i have faced same issue.

@AndrewVeee
Copy link

I think disabling AutomationControlled fixes this problem:

  browser = pw.chromium.launch_persistent_context(
      './chromium-data',
      args=["--disable-blink-features=AutomationControlled"],
  )

That seems to turn the "WebDriver" section green. Sadly, Cloudflare still manages to detect headless mode for me.

@iloveitaly
Copy link

@AndrewVeee were you able to get around headless detection on cloud flare?

@AndrewVeee
Copy link

I didn't have any luck getting around headless detection, but I gave up on it pretty early.

Instead, I used xvfb in Linux so the browser runs in a hidden X11. I would much prefer headless mode, but this works well enough for a light use case.

Hope that helps a little, I know it's not optimal.

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

4 participants