puppeteer-core is a high-level API for controlling Chrome or Firefox over the DevTools Protocol or WebDriver BiDi. Unlike its sibling `puppeteer`, `puppeteer-core` does *not* download a browser binary during installation, making it suitable for environments where you manage the browser executable yourself (e.g., AWS Lambda, CI/CD, or existing browser installations). The current stable version is 24.41.0, released in April 2026. The project maintains a rapid release cadence, often synchronizing with Chrome and Firefox releases, typically with multiple updates per month to incorporate new browser features, bug fixes, and security patches. It is designed for scenarios requiring fine-grained control over the browser executable or minimal install size, offering the same powerful API for web scraping, test automation, and PDF generation.
npm install puppeteer-coreVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to launch a browser using `puppeteer-core`, explicitly specifying the browser executable path, navigating to a page, interacting with elements, and logging content. It highlights `executablePath` which is crucial for `puppeteer-core`.
To explicitly use the 'new' headless mode, use `headless: true`. To revert to the 'old' headless mode, use `headless: 'shell'` or `headless: 'old'` (though 'old' is discouraged and may be removed). Review your scripts for compatibility with the new headless environment.
Launch Chromium with the `--no-sandbox` argument: `puppeteer.launch({ args: ['--no-sandbox', '--disable-setuid-sandbox'] })`. Be aware of the security implications of disabling sandboxing in production.If you use Jest with Puppeteer, ensure `jest-circus` (or your preferred test runner) is installed as a direct dependency in your project: `npm install --save-dev jest-circus`. Configure your Jest setup as needed.
Ensure your `executablePath` for `puppeteer-core` points to a recent, stable Chrome installation that is compatible with the `puppeteer-core` version you are using. Keep `puppeteer-core` updated to match the Chrome release cycle.
Prefer using `page.waitForNavigation()`, `page.waitForSelector()`, or the new Locator API (`page.locator('selector').click()`) for improved reliability and clarity in your automation scripts. Consult the official API documentation for recommended patterns.Double-check the `executablePath` to ensure it's correct for your operating system and points directly to the browser executable (e.g., `chrome.exe`, `Google Chrome`, `chromium`). Ensure the browser is actually installed at that location.
Verify the selector is correct and unique. Increase the timeout for `page.waitForSelector({ timeout: 60000 })` or `page.locator().waitHandle({ timeout: 60000 })`. Add `await page.waitForNavigation()` or `await page.waitForLoadState('networkidle')` before trying to find the element if it appears after a navigation or network request.Check the website for client-side errors during navigation. Add error handling around `page.goto()` and other navigation actions. Ensure the browser instance is stable and has sufficient resources. Sometimes, launching with `headless: false` can help debug on-screen errors.