Closed
Description
Version
1.53.0
Steps to reproduce
Install everything
pip install playwright
playwright install webkit
playwright install-deps webkit
run code
import asyncio
from playwright.async_api import async_playwright, Browser, Page
async def create_pdf():
playwright = await async_playwright().start()
browser = await playwright.webkit.launch(headless=True)
context = await browser.new_context(ignore_https_errors=True)
page = await context.new_page()
await page.set_viewport_size({"width": 1366, "height": 768})
await page.goto("https://google.com")
await page.pdf(path="/tmp/test.pdf", format="A4", print_background=True)
loop = asyncio.new_event_loop()
loop.run_until_complete(create_pdf())
Get error
Error: Page.pdf: PDF generation is only supported for Headless Chromium
Expected behavior
creates pdf
Actual behavior
undocummented error
Additional context
Is there any alternative? Should documentation have been updated about such restrictions?
Environment
- Operating System: [Ubuntu 22.04]
- CPU: [amd64]
- Browser: [WebKit]
- Python Version: [3.10]
Metadata
Metadata
Assignees
Labels
No labels