JavaScript web scraping libraries

Updated Nov 2026

JavaScript web scraping libraries fetch web pages and extract structured data from their HTML. Pages that build their content with JavaScript need a headless browser to render them before extraction. These libraries let AI agents and data pipelines collect prices, listings, and articles from sites without an API.

Popularity

Playwright has the most monthly downloads in this comparison, at 576.3M.

LibraryMonthly downloadsStarsLast releaseLicense
Playwright
642.0M
99.9KNov 2026Apache-2.0
jsdom
603.4M
21.8KNov 2026MIT
Cheerio
138.0M
30.5KJan 2026MIT
Happy DOM
130.1M
4.8KOct 2026MIT
puppeteer
59.9M
95.8KNov 2026Apache-2.0
Stagehand
10.2M
26.1KNov 2026MIT
selenium-webdriver
8.2M
34.6KNov 2026Apache-2.0
Firecrawl
4.5M
201.0KNov 2026MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Automates browser pages with unified APIs for multiple browser engines.

Downloads / mo
642.0M
Stars
99.9K
Last release
1.65.1
License
Apache-2.0

Strengths

  • Supports Chromium, Firefox, and WebKit. Use the same browser APIs across Chromium, Firefox, and WebKit.
  • Locators handle action readiness. Use locators for built-in waiting when interacting with page elements.

Limitations

  • Browser builds follow package versions. Install the browser builds that the installed Playwright version requires.

Quickstart

From library-js.md
$ npm install playwright npx playwright install webkit
const { webkit } = require('playwright');

(async () => {
  const browser = await webkit.launch();
  const page = await browser.newPage();
  await page.goto('https://playwright.dev/');
  await page.screenshot({ path: `example.png` });
  await browser.close();
})();

Playwright examples

From open-source projects on GitHub

Implements many web standards in JavaScript.

Downloads / mo
603.4M
Stars
21.8K
Last release
31.0.1
License
MIT

Quickstart

From README.md
$ npm install jsdom
const jsdom = require("jsdom");
const { JSDOM } = jsdom;

const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`);
console.log(dom.window.document.querySelector("p").textContent); // "Hello world"

Parses HTML and XML with a jQuery-like document API.

Downloads / mo
138.0M
Stars
30.5K
Last release
1.2.0
License
MIT

Strengths

  • Extracts with CSS selectors. Select elements with CSS selectors and read their text or attributes.
  • Loads from several input sources. Load HTML from strings, buffers, streams, or URLs.

Limitations

  • Dynamic content needs browser rendering. Cheerio does not execute page scripts or render CSS layouts.

Quickstart

From intro.md
$ npm install cheerio
import * as cheerio from 'cheerio';

const $ = cheerio.load('<h2 class="title">Hello world</h2>');

$('h2.title').text(); // "Hello world"

Cheerio examples

From open-source projects on GitHub

Happy DOM

Implements a web browser without its graphical interface, with WHATWG DOM and HTML standards.

Downloads / mo
130.1M
Stars
4.8K
Last release
21.0.4
License
MIT

Quickstart

From Browser.md
$ npm install happy-dom
import { Browser, BrowserErrorCaptureEnum } from 'happy-dom';

const browser = new Browser({ settings: { errorCapture: BrowserErrorCaptureEnum.processLevel } });
const page = browser.newPage();

// Navigates page
await page.goto('https://github.com/capricorn86');

// Clicks on link
page.mainFrame.document.querySelector('a[href*="capricorn86/happy-dom"]').click();

// Waits for all operations on the page to complete (fetch, timers etc.)
await page.waitUntilComplete();

// Outputs "GitHub - capricorn86/happy-dom: Happy DOM..."
console.log(page.mainFrame.document.title);

// Aborts all ongoing operations and closes the browser
await browser.close();

puppeteer

Controls Chrome and Firefox pages for browser-based automation and extraction.

Downloads / mo
59.9M
Stars
95.8K
Last release
25.18.1
License
Apache-2.0

Strengths

  • Controls Chrome and Firefox. Automate full browser pages through DevTools Protocol or WebDriver BiDi.
  • Captures full-page screenshots. Enable fullPage to capture beyond the visible viewport.

Limitations

  • Browser binaries need installation. Run the browser-install command when install scripts skip the browser download.
  • PDFs use print styles. Call emulateMediaType('screen') before pdf() when screen styles are required.

Quickstart

From README.md
$ npm install puppeteer
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/');

await browser.close();

Stagehand

Builds browser agents on Browserbase.

Downloads / mo
10.2M
Stars
26.1K
Last release
4.4.0
License
MIT

Quickstart

From quickstart.mdx
$ pnpm install @browserbasehq/stagehand 'zod@~4.4.3'
import { localBrowser, Stagehand } from "@browserbasehq/stagehand";
import { z } from "zod/v4";

const { OPENAI_API_KEY } = process.env;
if (!OPENAI_API_KEY) throw new Error();

const browser = await localBrowser.launch({ headless: true });
const stagehand = await Stagehand.create({
 browser,
 model: {
 modelName: "openai/gpt-5.4-mini",
 apiKey: OPENAI_API_KEY,
 },
});

const [page] = await browser.context.pages();
await page.goto("https://stagehand-eval-sites.vercel.app/sites/example/");

const result = await stagehand.extract(
 "Extract the page heading and description",
 z.object({
 heading: z.string(),
 description: z.string(),
 }),
);

console.log(JSON.stringify(result.data, null, 2));

await stagehand.close();
await browser.close();

selenium-webdriver

Provides the official Selenium WebDriver bindings for JavaScript.

Downloads / mo
8.2M
Stars
34.6K
Last release
4.53.0
License
Apache-2.0

Quickstart

From README.md
$ npm install selenium-webdriver
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-webdriver examples

From open-source projects on GitHub

Firecrawl

Searches, scrapes, crawls, and maps the web through the Firecrawl API for AI agents.

Downloads / mo
4.5M
Stars
201.0K
Last release
4.54.0
License
MIT

Quickstart

From README.md
$ npm install firecrawl
import { Firecrawl } from 'firecrawl';

const app = new Firecrawl({ apiKey: 'fc-YOUR_API_KEY' });

// Scrape a website
const scrapeResponse = await app.scrape('https://firecrawl.dev', {
  formats: ['markdown', 'html'],
});
console.log(scrapeResponse);

FAQ

Cheerio suits static pages whose data is already in the server's HTML. Playwright and puppeteer suit pages that render content with JavaScript. Firecrawl suits AI agents that want clean page content from a hosted API.

Firecrawl is a hosted API that searches, scrapes, crawls, and maps websites for AI agents. Its JavaScript SDK returns page content as Markdown or structured data.

puppeteer is a Node.js library that controls Chrome and Firefox through a high-level API. Scrapers use it to load pages, wait for content, and read the rendered DOM.

Cheerio parses HTML and XML and exposes a jQuery-like API for selecting elements. It does not run page scripts or render the page.

selenium-webdriver drives browsers through the WebDriver standard. Playwright controls Chromium, Firefox, and WebKit through its own protocol with automatic waiting.

puppeteer controls Chrome and Firefox from Node.js. Playwright adds WebKit and ships clients for Python, Java, and .NET as well.

For coding agents

Found your web scraping library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official