Open dly667 opened 1 year ago
It doesn't work, because some scripts require actual Playwright instance.
For example:
https://github.com/berstend/puppeteer-extra/blob/master/packages/puppeteer-extra-plugin-stealth/evasions/user-agent-override/index.js that require page
:
async onPageCreated(page) {
// Determine the full user agent string, strip the "Headless" part
let ua =
this.opts.userAgent ||
(await page.browser().userAgent()).replace('HeadlessChrome/', 'Chrome/')
(...)
const client =
typeof page._client === 'function' ? page._client() : page._client
client.send('Network.setUserAgentOverride', override)
Can playwright-python use this library through page.evaluate(''stealth.min.js"), It didn't work when tested