Skip to main content
Playwright is a modern browser automation framework with auto-waiting, powerful selectors, and multi-browser support.

Installation

Quick Start

With Session Options

Using Existing Contexts

Driver sessions may have a pre-existing browser context. Always check before creating a new one:

With Persistent Profiles

Error Handling

Tips

  • Use page.waitForLoadState('networkidle') for pages with dynamic content
  • Driver sessions support all Playwright features including screenshots, PDFs, and tracing
  • For long-running tasks, monitor session status and handle reconnection
  • Use browser.close() to end your Playwright connection. Unlike Puppeteer’s browser.disconnect(), this properly closes the CDP connection while the Driver session can still be stopped separately via the API