-
-
Notifications
You must be signed in to change notification settings - Fork 772
Playwright vs Puppeteer
berstend̡̲̫̹̠̖͚͓̔̄̓̐̄͛̀͘ edited this page Nov 28, 2020
·
22 revisions
- Playwright and Puppeteer are modern browser automation libraries to control real browsers with code
- Both are Node.js based and use the Chrome DevTools Protocol (CDP) behind the scenes
- They share the same roots and their APIs (e.g.
page.goto()
) are often the same or very similar
Switching them out later is relatively easy as their APIs are so similar, choose based on your current needs.
-
Choose Playwright
- if you need to use browsers other than Chrome/Chromium right now
-
Choose Puppeteer
- if you rely on being able to use plugins like
stealth
right now
- if you rely on being able to use plugins like
- Puppeteer started as official Google project in 2017 and quickly gained popularity
- It's considered to be the first modern browser automation tool, after projects like Selenium and PhantomJS
- Playwright started in 2020 after Microsoft
boughthired a few of the core Puppeteer maintainers- They started fresh with prior experience: TypeScript and multi-browser support from the get go
- Both are actively maintained and push regular updates
- We started the project in 2018 with
puppeteer-extra
, a modular plugin framework for Puppeteer- We introduced popular plugins like
stealth
andrecaptcha
- Plugins are based off
puppeteer-extra-plugin
- We introduced popular plugins like
- We rewrote the plugin framework in 2020 to support Playwright as well
- A new
automation-extra
package acts as a shared foundation for all drivers -
playwright-extra
&puppeteer-extra
are slim entry points forautomation-extra
- New plugins will be based off
automation-extra-plugin
, which supports Playwright & Puppeteer events
- A new
- Playwright support in the plugin framework doesn't mean all existing plugins can be used with Playwright immediately
- The existing
puppeteer-extra
plugins need to be ported toautomation-extra-plugin
and optimized to be used with Firefox and Webkit as well
- The existing
- New plugins work with both
playwright-extra
as well aspuppeteer-extra
and usually all browsers - You can recognize new plugins by their package name:
@extra/foobar
as opposed topuppeteer-extra-plugin-foobar
- Playwright has first class support for Chromium, Firefox and Webkit browsers
- They accomplish this by maintaining a set of browser patches and shipping custom binaries
- They introduced a unified wire protocol which internally translates to CDP, Juggler, WDP
- Puppeteer has been heavily Chromium focussed and only recently added Firefox support to their core
- Instead of maintaining patches they work with the browser vendors to improve their CDP functionality
- Their Firefox support is currently no match for Playwright, even basic features are missing
- The biggest difference between the two (in API usage) is Playwright heavily using the concept of "browser contexts"
- Playwright
-
Puppeteer
- Github | Documentation | API reference
- Is Puppeteer Firefox ready yet? https://puppeteer.github.io/ispuppeteerfirefoxready/