Crawlee - how to set timezone?
Ok, I know in which country are my proxies/IPs, so I can set locale:
BUT! How to set the timezone corresponding to the country?
This is not a theoretical question: this site: https://pixelscan.net
checks timezone, detects "Africa/Abidjan", compares it with my IP in German datacenter
and says "Look like you spoofing your location". (attached - two parts of the huge screenshot made in headless mode with PlaywrightCrawler)
So how to set/control timezone?
Pixelscan
Pixelscan is a one-and-done solution to detect internet bots and manually-controlled browsers with irregular connections between browser fingerprint parameters.

9 Replies
foreign-sapphireOP•3y ago
part of screenshot from https://pixelscan.net
Pixelscan
Pixelscan is a one-and-done solution to detect internet bots and manually-controlled browsers with irregular connections between browser fingerprint parameters.

fascinating-indigo•3y ago
There is property
timezoneId
in playwright.newContext(...)
https://playwright.dev/docs/api/class-browser#browser-new-context-option-timezone-idBrowser | Playwright
* extends: [EventEmitter]
foreign-sapphireOP•3y ago
@LeMoussel would you pls help me using timezoneId in Crawlee? (I have difficulties connecting Plawright API and Crawlee)
This is configuration of my PlaywrightCrawler:
I think - timezoneId it should be somewhere in the launchContext... but where?
fascinating-indigo•3y ago
This actually shows exactly what you need.
https://github.com/apify/apify-js/blob/master/MIGRATIONS.md#configuration-and-lifecycle-hooks
https://github.com/apify/browser-pool#browserpool
GitHub
crawlee/MIGRATIONS.md at master · apify/crawlee
Crawlee—A web scraping and browser automation library for Node.js that helps you build reliable crawlers. Fast. - crawlee/MIGRATIONS.md at master · apify/crawlee
GitHub
GitHub - apify/browser-pool: A Node.js library to easily manage and...
A Node.js library to easily manage and rotate a pool of web browsers, using any of the popular browser automation libraries like Puppeteer, Playwright, or SecretAgent. - GitHub - apify/browser-pool...
fascinating-indigo•3y ago
With this working code:
Another option is to set
launchOptions
in launchContext
like this:
IMPORTANT: In all cases, useIncognitoPages
must be set to false
foreign-sapphireOP•3y ago
awesome! this thing with preLaunchHooks, and with useIncognitoPages: false AND with these settings in fingerprintGeneratorOptions (I set locales additionally):
-- with all this... it finally works and pixelscan.net believes I'm in Germany (which is true, no proxies used in this test.. yet)... see screenshots



foreign-sapphireOP•3y ago
@Lukas Krivka - I think, such example should be added to Crawlee documentation.
Without @LeMoussel I would never figure out how it works
Yes, I tried to set "launchOptions" this way - does not works! no idea why....
inland-turquoise•3y ago
new headless chrome passes all the pixelscan checks as well as creepJS. Do check it out once
When we use proxies then I see location is being spoofed message coming up on pixelscan using new headless. Any idea how to avoid it?
unwilling-turquoise•3y ago
@Adi Is that the Web RTC leak perhaps? As I wrote, it will be fixed soonish