How to set screenshot resolution in Pyppeteer
This example is the same as Pyppeteer minimal screenshot example , but sets the page size = screenshot resolution to 1920x1080px.
#!/usr/bin/env python3
import asyncio
from pyppeteer import launch
async def main():
browser = await launch({
"defaultViewport": {"width": 1920, "height": 1080}
})
page = await browser.newPage()
await page.goto('https://www.techoverflow.net')
# Make screenshot
await page.screenshot({'path': 'screenshot.png'})
# Cleanup
await browser.close()
asyncio.get_event_loop().run_until_complete(main())