Puppeteer allows blocking any outgoing requests while loading the page. Whether you want to block ads, tracking scripts, or different types of resources, it is relatively easy to do with Puppeteer.
How to set a time zone in Puppeteer for page
Puppeteer allows blocking any outgoing requests while loading the page. Whether you want to block ads, tracking scripts, or different types of resources, it is relatively easy to do with Puppeteer.
By the way, in our screenshot API, you can take the screenshot of the element by specifying the time zone parameter.
Puppeteer allows changing the time zone on a per-page basis. In automation testing, you can test how the website behaves for different time zones. Or you can use it for scrapping to imitate the user from the expected time zone by the site.
It is reasonably simple to do by using page.emulateTimezone(timezoneId):
const puppeteer = require('puppeteer');
(async () => { const browser = await puppeteer.launch({}); try { const page = await browser.newPage();
await page.emulateTimezone('Europe/London');
await page.goto('https://screenshotone.com/'); } catch (e) { console.log(e) } finally { await browser.close(); }})();
The list of available time zones you can find at Chromium source code, these are the most popular ones:
I hope I have helped solve the issue and I wish you a nice day!
Interviews, tips, guides, industry best practices, and news.
Two years have passed since the launch of ScreenshotOne, and I want to do a fun coding exercise and build a tiny subset of what the API is today, but from scratch.
I had a great chat with Alexander Schnebel, the fullstack software engineer behind Productglowup.
From today, you can render screenshots of any website or even raw HTML in ChatGPT—ScreenshotOne is available as a plugin. But at the moment of writing not available yet, in the official store, but it can be available when you read it.
Exhaustive documentation, ready SDKs, no-code tools, and other automation to help you render website screenshots and outsource all the boring work related to that to us.