playwright-go
playwright-go copied to clipboard
Does playwright-go has Stealth Mode support built-in?
I've just head of Playwright-go and would like to evaluate it. One thing I need badly is Stealth Mode which could be used as Anti-Bot Detectoon similar to go-rod. I couldn't find anything in the examples/ folder for Playwright-go.
You could use go-rod's js with playwright-go
e.g.
userAgent := "some valid user agent"
context, _ := browser.NewContext(playwright.BrowserNewContextOptions{
UserAgent: playwright.String(userAgent),
})
page, _ := context.NewPage()
if err := page.AddInitScript(playwright.PageAddInitScriptOptions{
Script: playwright.String(stealth.JS),
}); err != nil {
// something didn't work
}
Thank you very much for the snippet.
Stealth mode is not in the scope of playwright-go.
ty for the stealth scripts rec! This solved my exact issue. 🙌
@jdfergason Thanks for posting this solution, can you please help me with stealth.JS file URL or some clue around that from where I could get that file?
Thanks
It's bundled with go-rod or you can get it directly from npm: https://www.npmjs.com/package/puppeteer-extra-plugin-stealth