I am using puppeteer to take page screnshot of a particular width:
await page.setViewport({width: 320, height: 0})
await page.goto(url)
await page.screenshot({path: `screenshot.png`, fullPage: true});
The width of screenshot is exactly 320px. But is it possible to save scaled screenshot (e. g. 2 times larger)? Like in Developer Tools - I can set zoom 150% there.
You can use deviceScaleFactor
on page.setViewport
await page.setViewport({width: 320, height: 0, deviceScaleFactor:2});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With