Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer is a JavaScript library for automating Chrome and Firefox from Node.js. A script can launch or connect to a browser, open pages, navigate to sites, interact with page elements, and produce output such as screenshots and PDFs. It runs headless by default, but can also show a visible browser window. It is a library—not a browser or desktop application.

What is Puppeteer used for?

Puppeteer gives JavaScript programs a high-level way to control a browser. Its documented use cases include:

  • Automated UI tests, including filling and submitting forms and using keyboard, mouse, or touch input.
  • Capturing screenshots and PDFs.
  • Testing browser features and Chrome extensions.
  • Collecting performance timeline traces.
  • Crawling single-page applications to generate prerendered content.

These are supported task categories, not guarantees that a particular site or test will work without configuration. Pages may load asynchronously, require authentication, display bot checks, or behave differently across browser versions. Puppeteer provides the controls; your script still needs to handle the target site’s requirements and failure cases.

How Puppeteer works

A typical script launches a browser, creates a page, navigates to a URL, and uses the API to inspect or interact with the page. It can run headless (without a visible UI) or headful (with a visible browser). Puppeteer automates user-style mouse, touch, and keyboard actions. CSS selectors are supported, along with text, accessibility attributes, XPath, and Shadow DOM selectors. The project recommends locators, which can wait for an element to appear and reach a suitable state before acting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Browser contexts let a script isolate sessions: cookies and local storage are not shared between separate contexts. This is useful when tests need independent browser state. For a browser Puppeteer launched, browser.close() shuts it down. If Puppeteer connected to a browser launched elsewhere, browser.disconnect() disconnects the client without shutting down that browser or closing its pages.

Install Puppeteer and run a first script

For a straightforward start, install the puppeteer package. The documented package setup downloads a compatible Chrome during installation.

  1. Check prerequisites: have Node.js and npm available in your project.
  2. Install: run npm install puppeteer in the project directory.
  3. Create a file: save the following as example.mjs.
  4. Run it: use node example.mjs. The script opens a page, visits a URL, prints its title, saves a screenshot, and closes the browser.
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
  console.log(await page.title());
  await page.screenshot({ path: 'example.png' });
} finally {
  await browser.close();
}

This example uses ES modules. If your project uses CommonJS, adapt the import to the module system you have configured. The finally block closes the browser even if navigation or capture throws an error. Choose an appropriate navigation wait condition for the site: waiting for full network idleness can be unsuitable on pages that keep background requests open.

Interact with a page

For interaction, prefer Puppeteer’s locator API when it fits the task; its waits reduce race conditions caused by scripts acting before an element is ready. The exact selectors and actions depend on the page. Use stable selectors and verify the resulting state rather than assuming that a click succeeded.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Choose between puppeteer and puppeteer-core

Package Browser setup Good fit
puppeteer Downloads a compatible Chrome during installation. Projects where Puppeteer should manage the bundled browser and a simple initial setup is preferred.
puppeteer-core Installs the library without downloading Chrome; the project supplies or manages the browser separately. Environments with an existing browser installation or a separately managed browser.

The key documented distinction is browser download and management, not a separate automation API. With puppeteer-core, plan how your deployment will locate, install, and update its browser. With either package, align browser versions with the Puppeteer release you use.

Does Puppeteer support Firefox, and which protocol does it use?

Puppeteer supports Chrome and Firefox. According to the official FAQ, Chrome uses the Chrome DevTools Protocol (CDP) by default and can also be automated through WebDriver BiDi; Firefox uses WebDriver BiDi by default. The FAQ describes WebDriver BiDi support for both browsers as production-ready since Puppeteer v23.0.0, while noting that Chrome CDP support will continue. Confirm the current guidance for your chosen browser and project before relying on a particular protocol.

Browser compatibility is version-coupled: Puppeteer releases are paired with browser releases so protocol changes are less likely to break automation unexpectedly. The documentation’s version table checked on September 29, 2026 listed Puppeteer v25.12.0 with Chrome for Testing 154.0.8037.57 and Firefox 156.0.1. These values change; consult the current supported browsers table rather than pinning a browser based on an old article.

Is Puppeteer a replacement for Selenium?

Not universally. Puppeteer is a JavaScript browser-automation library whose documented browser and protocol support centers on Chrome and Firefox, CDP, and WebDriver BiDi. Selenium offers bindings for more programming languages and tooling for large-scale orchestration, including Selenium Grid. The right choice depends on the languages in your team, target browsers and protocols, version-management approach, and whether you need distributed orchestration. A Node.js project focused on Puppeteer’s supported browsers may find Puppeteer direct; a polyglot or grid-oriented setup may value Selenium’s broader language and orchestration options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Capture a screenshot without managing a browser

Puppeteer is useful when you need programmatic browser control, interaction, or test logic. If the task is simply to request a website screenshot or PDF, a screenshot API can avoid installing and maintaining a browser for that capture.

Or skip the browser setup

ScreenshotNeo provides a one-request screenshot API. For example, with cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for options and response details. Cookie banners are accepted like a visitor and removed, along with known newsletter popups and chat widgets, before capture; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers indicate the page verdict and whether the shot was billed. ScreenshotNeo also has an MCP server with screenshot, page-info, and PDF tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

Sign up for ScreenshotNeo’s free plan.

Troubleshooting common Puppeteer issues

Installation fails or Chrome is missing

The puppeteer package downloads a compatible Chrome during installation, so a failed or skipped browser download can leave the package without its expected browser. Check the install output and your environment’s network and installation restrictions. If your environment supplies a browser separately, use puppeteer-core and explicitly manage that browser rather than assuming the bundled download exists.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The script cannot launch in a deployment environment

Check that the deployed environment includes the browser and its required operating-system dependencies, and that the process can access the browser executable. If you use puppeteer-core, verify the configured browser path. Also check deployment restrictions and logs for the launch error; local success does not establish that the production environment is configured the same way.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

A selector is not found or an action happens too early

The page may not have rendered the target element when the script attempts to use it, or the selector may not match the live page. Check the selector against the rendered page and use a locator that waits for the element and a suitable state. For shadow-DOM or accessibility-based targets, use an appropriate supported selector rather than assuming ordinary CSS will cross every boundary.

Navigation hangs or times out

A page may keep network connections open, making a wait for network idleness impractical, or it may load content after the chosen navigation event. Pick the wait condition that matches the task, then wait for a meaningful page element if necessary. Set and handle a timeout appropriate to your workflow; do not treat a timeout as proof that the destination is blank.

Browser and Puppeteer behave incompatibly

Check that the browser version matches the Puppeteer release’s supported pairing. This is especially important when a browser is managed independently or updated outside the project. Consult the current compatibility table and make browser updates deliberate rather than assuming any installed Chrome or Firefox is interchangeable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and cost considerations

Puppeteer runs browser automation locally or in infrastructure you operate; the package choice determines whether installation downloads Chrome or leaves browser management to your environment. A browser consumes more resources than a simple HTTP request, and parallel pages or browser instances can increase memory and CPU demand. Reuse a browser process where appropriate, isolate independent sessions with browser contexts, and close resources when finished. For robust automation, account for slow or dynamic pages, transient network errors, authentication, bot defenses, and changing site markup.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

The cited official documentation does not establish a universal runtime, hosting cost, or throughput figure. Measure your own workload under its actual browser, page, concurrency, and deployment conditions. The project itself is a JavaScript library; any compute or browser-infrastructure cost depends on where and how you run it.

Frequently Asked Questions

Is Puppeteer a browser?

No. It is a JavaScript library that controls a browser such as Chrome or Firefox.

Can Puppeteer run without a visible browser window?

Yes. It runs headless by default and can also be configured to show a visible browser.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does Puppeteer only work with Chrome?

No. It supports Chrome and Firefox, with protocol defaults that differ by browser.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.