Playwright Core is the foundational JavaScript library for automating web browsers, providing a high-level API to control Chromium, Firefox, and WebKit through a single interface. It is designed for robust end-to-end testing, web scraping, and general browser automation tasks. As of version 1.59.1, the project maintains a rapid release cadence, typically monthly, delivering new features and browser updates. Recent additions include the `page.screencast` API for comprehensive recording capabilities and the introduction of a new CLI mode (`playwright-cli`) for AI agent-friendly, token-efficient operations. Key differentiators of Playwright Core include its auto-waiting functionality, resilient element interaction APIs, and native mobile emulation. While this package provides the raw browser automation API, it commonly serves as the underlying engine for the broader `playwright` package, which integrates a full test runner and pre-built browser binaries. It requires Node.js version 18 or higher to operate.
npm install playwright-coreVerified import paths — ran on the pinned version, not inferred.
Demonstrates launching a headless Chromium browser, navigating to multiple pages, taking a screenshot, interacting with an element, and verifying the URL after navigation using Playwright Core.
Migrate Chromium extensions to Manifest V3. Consult Chromium documentation for migration guides.
For a complete testing solution including test runner and auto-downloaded browsers, install `playwright` (`npm i -D playwright`). If you only need `playwright-core`, ensure you manually install browser binaries using `npx playwright install` or `npx playwright install chromium`.
Upgrade your Node.js environment to version 18 or newer. Use a Node Version Manager (NVM) for easy switching (e.g., `nvm install 18 && nvm use 18`).
This fix is included in `v1.59.1`. If encountering issues with `codegen`, `--ui`, or `show` commands on Windows with older versions, update to `v1.59.1` or newer. The console window will now be visible during browser spawning on Windows.
Change your import statements from `const { chromium } = require('playwright-core');` to `import { chromium } from 'playwright-core';`. Ensure your `package.json` specifies `"type": "module"` or use `.mjs` file extensions.Run `npx playwright install chromium` to download and install the Chromium browser binaries. For all browsers, use `npx playwright install`.
Upgrade your Node.js environment to version 18 or newer. Use NVM (`nvm install 18 && nvm use 18`) or update through your system's package manager.
Ensure the selector is correct and the element is present and visible on the page. Use `page.waitForSelector()` with appropriate state options (`'visible'`, `'attached'`, `'loaded'`) before interacting, or increase the locator's timeout: `page.locator('selector').click({ timeout: 60000 })`.No dependency data recorded yet.