const crawler = new PlaywrightCrawler({ ... fingerprintOptions: { fingerprintGeneratorOptions: { locales: [ ... ], ...
timezoneId
in playwright.newContext(...)
const crawler = new PlaywrightCrawler({ autoscaledPoolOptions: { minConcurrency: 2, maxConcurrency: 4, loggingIntervalSecs: null, }, maxRequestRetries: 0, navigationTimeoutSecs: 130, requestHandlerTimeoutSecs: 110, useSessionPool: false, persistCookiesPerSession: false, headless: true, browserPoolOptions: { useFingerprints: true, operationTimeoutSecs: 40, fingerprintOptions: { fingerprintGeneratorOptions: { browsers: ['firefox'], operatingSystems: ['linux'], locales: ['de-DE', 'de'], }, }, }, launchContext: { useIncognitoPages: true, launcher: firefox },
import { PlaywrightCrawler, // https://crawlee.dev/docs/examples/playwright-crawler sleep, } from 'crawlee'; import { firefox } from 'playwright'; const crawler = new PlaywrightCrawler({ headless: false, maxConcurrency: 4, minConcurrency: 2, maxRequestRetries: 0, navigationTimeoutSecs: 130, requestHandlerTimeoutSecs: 110, useSessionPool: false, persistCookiesPerSession: false, browserPoolOptions: { useFingerprints: true, operationTimeoutSecs: 40, fingerprintOptions: { fingerprintGeneratorOptions: { browsers: ['firefox'], operatingSystems: ['linux'], }, }, preLaunchHooks: [ async (pageId, launchContext) => { launchContext.launchOptions.locale = 'en-AU' launchContext.launchOptions.timezoneId='Australia/Brisbane' } ], }, launchContext: { useIncognitoPages: false, launcher: firefox }, async requestHandler({ request, page, log }) { log.info(`GET ${request.url} DONE`); // To get the system's IANA timezone in JavaScript (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) const timezoneFromJavascript = await page.evaluate('Intl.DateTimeFormat().resolvedOptions().timeZone'); log.info(`Timezone from Javascript: ${timezoneFromJavascript}`) if (request.userData.site === 'pixelscan') { await sleep(10000); } const url = new URL(request.url); await page.screenshot( {path:`${url.host}.png`, fullPage:true} ); }, }); await crawler.run([ { url: "https://pixelscan.net/" , userData: { site: "pixelscan" } } ]);
launchOptions
in launchContext
like this:launchContext: { launchOptions: { locale: 'en-AU', timezoneId: 'Australia/Brisbane' }, useIncognitoPages: false, launcher: firefox },
useIncognitoPages
must be set to false
fingerprintGeneratorOptions: { browsers: ['firefox'], operatingSystems: ['linux'], locales: ['de-DE'], },