Pyppeteer minimal screenshot example

This script is a minimal example on how to use Pyppeteer to fetch a web page and save a screenshot to screenshot.png:

#!/usr/bin/env python3
import asyncio
from pyppeteer import launch

async def main():
    browser = await launch()
    page = await browser.newPage()
    await page.goto('')
    # Make screenshot
    await page.screenshot({'path': 'screenshot.png'})
    # Cleanup
    await browser.close()


How to run:

sudo pip3 install pyppeteer