YouTip LogoYouTip

Playwright Tutorial - Getting Started

Playwright

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch()
    page = browser.new_page()
    page.goto("https://example.com")
    print(page.title())
    page.screenshot(path="screenshot.png")
    browser.close()

Summary

  • Playwright is a modern browser automation tool
  • Supports Chromium, Firefox, WebKit
← Electron Tutorial - Getting StSelenium Tutorial - Getting St β†’