Custom user agent playwright browser
how can put a custom user agent into the playwright crawler context?

8 Replies
harsh-harlequinOP•2y ago
Like the image above
like-gold•2y ago
Hey there, please check the browser pool docs: https://github.com/apify/browser-pool#manipulating-playwright-context-using-pageoptions-or-launchoptions + https://crawlee.dev/api/playwright-crawler/interface/PlaywrightLaunchContext#launchOptions
harsh-harlequinOP•2y ago
I Already tried, but it doesn't set the user agent in the browser, just the header.
like-gold•2y ago
what do you mean by that? If you see it the headers - it means it's set. If you see this user-agent in browser request headers - it means it's set
harsh-harlequinOP•2y ago
My crawlee is printing this agent

harsh-harlequinOP•2y ago
i want this 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 Edg/104.0.1293.63'
harsh-harlequinOP•2y ago
I tried to put but not work

like-gold•2y ago
Got it. This should work:
and maybe also switch off fingerprints (but not necessary):
browserPoolOptions: { useFingerprints: false },
as another crawler option