The Chrome Browser Automation team maintains the library, but we’d love your help and expertise on the project! See our contributing guide.
From Puppeteer v23.0.0 onwards Puppeteer provides support for both Chrome and Firefox.
To automate Chrome Puppeteer uses the Chrome DevTools Protocol (CDP) by default, but it can also be automated using WebDriver BiDi which is the default for automating Firefox.
To understand the subtle differences in API support refer to our WebDriver BiDi guide.
From Puppeteer v23.0.0 and up Puppeteer has production-ready support for WebDriver BiDi to automate both Chrome and Firefox.
We are not going to stop supporting automation of Chrome with CDP - despite Puppeteer’s support for WebDriver BiDi. To not break existing automations relying on CDP, but also to keep enabling automation use-cases unique to Chrome and not standardized with WebDriver BiDi.
The goals of the project are:
We adapt Chromium principles to help us drive product decisions:
Puppeteer is a Node.js based reference implementation of how to automate browsers with CDP and WebDriver BiDi - the same web standard the Selenium project is also contributing to.
The Selenium project goes beyond what Puppeteer offers in multiple aspects: it provides bindings for more languages than just JavaScript and for example it also offers tooling to orchestrate automation at large, like Selenium Grid. Both is beyond Puppeteer’s scope.
There are community projects that add capabilities to Puppeteer beyond its core, making things like testing more convenient. For example see:
Every Puppeteer release is tightly bundled with a specific browser release to ensure compatibility with the implementation of the underlying protocols, the Chrome DevTools Protocol and WebDriver BiDi.
This is to prevent changes in either Chrome or Firefox from unexpectedly breaking Puppeteer.
Look for the chrome
and firefox
entries in
revisions.ts.
From Puppeteer’s standpoint, “navigation” is anything that changes a page’s URL. Aside from regular navigation where the browser hits the network to fetch a new document from the web server, this includes anchor navigations and History API usage.
With this definition of “navigation,” Puppeteer works seamlessly with single-page applications.
In browsers, input events could be divided into two big groups: trusted vs. untrusted.
document.createEvent
or element.click()
methods.Websites can distinguish between these two groups:
Event.isTrusted
event flag'click'
event
is preceded by 'mousedown'
and 'mouseup'
events.For automation purposes it’s important to generate trusted events. All input
events generated with Puppeteer are trusted and fire proper accompanying
events. If, for some reason, one needs an untrusted event, it’s always
possible to hop into a page context with page.evaluate
and generate a fake
event:
await page.evaluate(() => {
document.querySelector('button[type=submit]').click();
});
Puppeteer uses Chrome for Testing binaries by default which ship with properietary codecs support starting from M120.
We have a troubleshooting guide for various operating systems that lists the required dependencies.
There are many ways to get help on Puppeteer:
Make sure to search these channels before posting your question.