NPM Star
Collections
  1. Home
  2. Compare
  3. puppeteer vs selenium-webdriver
NPM Compare

Compare NPM packages statistics, trends, and features

CollectionsVS Code extensionChrome extensionTermsPrivacyLinkTreeIndiehackersBig Frontendqiuyumi

Unable to load comparison data. Please try again later.

Puppeteer

build npm puppeteer package

<img src="https://user-images.githubusercontent.com/10379601/29446482-04f7036a-841f-11e7-9872-91d1fc2ea683.png" height="200" align="right"/>

Puppeteer is a JavaScript library which provides a high-level API to control Chrome or Firefox over the DevTools Protocol or WebDriver BiDi. Puppeteer runs in the headless (no visible UI) by default

Get started | API | FAQ | Contributing | Troubleshooting

Installation

npm i puppeteer # Downloads compatible Chrome during installation. npm i puppeteer-core # Alternatively, install as a library, without downloading Chrome.

MCP

Install chrome-devtools-mcp, a Puppeteer-based MCP server for browser automation and debugging.

Puppeteer also supports the experimental WebMCP API.

Example

import puppeteer from 'puppeteer'; // Or import puppeteer from 'puppeteer-core'; // Launch the browser and open a new blank page. const browser = await puppeteer.launch(); const page = await browser.newPage(); // Navigate the page to a URL. await page.goto('https://developer.chrome.com/'); // Set the screen size. await page.setViewport({width: 1080, height: 1024}); // Open the search menu using the keyboard. await page.keyboard.press('/'); // Type into search box using accessible input name. await page.locator('::-p-aria(Search)').fill('automate beyond recorder'); // Wait and click on first result. await page.locator('.devsite-result-item-link').click(); // Locate the full title with a unique string. const textSelector = await page .locator('::-p-text(Customize and automate)') .waitHandle(); const fullTitle = await textSelector?.evaluate(el => el.textContent); // Print the full title. console.log('The title of this blog post is "%s".', fullTitle); await browser.close();

selenium-webdriver

JavaScript language bindings for Selenium WebDriver. Selenium automates browsers for testing and web-based task automation.

Requires Node.js >= 20.

Installation

npm install selenium-webdriver

Quick Start

const { Builder, Browser } = require('selenium-webdriver') ;(async function example() { let driver = await new Builder().forBrowser(Browser.CHROME).build() try { await driver.get('https://www.selenium.dev') console.log(await driver.getTitle()) } finally { await driver.quit() } })()

Selenium Manager automatically handles browser driver installation — no manual driver setup required.

Configuring the Builder

The Builder sets default options for all browsers in a single chain; options for non-selected browsers are dropped at build() time. The target browser can be swapped at runtime via the SELENIUM_BROWSER environment variable.

const { Builder, Browser } = require('selenium-webdriver') const chrome = require('selenium-webdriver/chrome') const firefox = require('selenium-webdriver/firefox') let driver = new Builder() .forBrowser(Browser.FIREFOX) .setChromeOptions(new chrome.Options()) .setFirefoxOptions(new firefox.Options()) .build()

Running Against a Remote Server

To run scripts against a Selenium Grid or standalone server, point the Builder at the server URL, or set SELENIUM_REMOTE_URL:

let driver = new Builder().forBrowser(Browser.CHROME).usingServer('http://localhost:4444').build()
SELENIUM_REMOTE_URL="http://localhost:4444" node script.js

Node Support Policy

Each selenium-webdriver release targets the latest semver-minor of Node's LTS and Current releases.

| Level | Guarantee | | :------------ | :------------------------------------------------------------------------ | | supported | API compatible without runtime flags; bugs investigated and fixed. | | best effort | Bugs investigated as time permits; API compatibility only where required. | | unsupported | Bug reports closed as will-not-fix; API compatibility not guaranteed. |

Versions older than the active LTS, unstable release branches (e.g. v.Next), and semver-major Node releases outside the LTS / Current pair are unsupported.

Documentation

  • Getting Started
  • JavaScript API Docs
  • Selenium Manager
  • Selenium Grid

Support

  • Selenium Chat
  • GitHub Issues

Contributing

Contributions are welcome via GitHub pull requests. See the source code for this binding.

Links

  • npm
  • Documentation

License

Licensed under the Apache License 2.0.

Dependencies Comparison

puppeteer

Dependencies

@puppeteer/browsers3.0.4
chromium-bidi16.0.1
lilconfig^3.1.3
devtools-protocol0.0.1624250
puppeteer-core25.1.0
typed-query-selector^2.12.2

Dev Dependencies

@types/node^18.17.15

Peer Dependencies

selenium-webdriver

Dependencies

@bazel/runfiles^6.5.0
jszip^3.10.1
tmp^0.2.5
ws^8.20.1

Dev Dependencies

@eslint/js^9.39.4
clean-jsdoc-theme^4.3.2
eslint^9.39.4
eslint-config-prettier^10.1.8
eslint-plugin-mocha^10.5.0
eslint-plugin-n^17.24.0
eslint-plugin-no-only-tests^3.4.0
eslint-plugin-prettier^5.5.5
express^4.22.2
globals^15.15.0
has-flag^5.0.1
jsdoc^4.0.5
mocha^11.7.5
mocha-junit-reporter^2.2.1
multer2.0.2
prettier^3.8.3
serve-index^1.9.2
sinon^19.0.5
supports-color^10.2.2

Peer Dependencies

StarsIssuesVersionUpdatedⓘLast publish dateCreatedⓘPackage creation dateSizeⓘMinified + Gzipped size
P
puppeteer
00N/AN/AN/Ainstall size N/A
S
selenium-webdriver
34,1831914.44.0a month ago13 years agoinstall size 90.7 KB

Who's Using These Packages

puppeteer

bootbox
bootbox

Wrappers for JavaScript alert(), confirm() and other flexible dialogs using Twitter's bootstrap framework

BookStack
BookStack

BookStack,基于MinDoc,使用Beego开发的在线文档管理系统,功能类似Gitbook和看云。

IDP
IDP

IDP is an open source AI IDE for data scientists and big data engineers.

benefit
benefit

✨ Utility CSS-in-JS library that provides a set of low-level, configurable, ready-to-use styles

Firestream
Firestream

A production ready streaming Data Warehouse.

selenium-webdriver

OSEP
OSEP

Open Scratch Extension Platform