correct-apricot•2y ago
New fingerprint per new request with PlaywrightCrawler/Firefox ?
Hi all,
what I want to achieve:
- every request should have unique fingerprint - this is important! - cookies, etc. not shared between requests - PlaywrightCrawler - no sessions - every request is independent, (no login or similar) - Firefox - performance/throughput is not a number one prio At the moment I almost have this with the hack
- every request should have unique fingerprint - this is important! - cookies, etc. not shared between requests - PlaywrightCrawler - no sessions - every request is independent, (no login or similar) - Firefox - performance/throughput is not a number one prio At the moment I almost have this with the hack
retireBrowserAfterPageCount=2
in browserPoolOptions
: this gives a unique fingerprint every two requests, which... isn't perfect (and starting a new browser instance so often looks strange)
In this thread: https://discord.com/channels/801163717915574323/1060467542616965150
a solution for browser pool (without crawler) was suggested.
I would like to have both: new fingerprint per request and PlaywrightCrawler.
Is it possible?1 Reply
Well, you can do
retireBrowserAfterPageCount=1
, it just has a bit worse performance since it needs to open new browser window every time.
Second option is to try hacky https://crawlee.dev/api/puppeteer-crawler/interface/PuppeteerLaunchContext#experimentalContainersPuppeteerLaunchContext | API | Crawlee
Apify extends the launch options of Puppeteer.
You can use any of the Puppeteer compatible
LaunchOptions
options by providing the launchOptions
property.
Example:
```js
// launch a headless Chrome (not Chromium)
const launchContext = {
// Apify helpers
useCh...