Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Read html file and make pdf with pyppeteer
import asyncio
from pyppeteer import launch
async def main():
browser = await launch(
'headless': True,
'args': [
page = await browser.newPage()
await page.goto('file:///root/sample.html')
await page.screenshot({'path': 'sample.png'})
await page.pdf({'path': 'sample.pdf'})
await browser.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment