Skip to content

Cheerio

A fast library for parsing and changing HTML and XML using a jQuery-like syntax.

Stars
30.5k
Forks
1.7k
Licence
MIT
Language
TypeScript
Last update
4 days ago
Type
Library

What it is

Cheerio is a JavaScript and TypeScript library that loads HTML or XML text into a tree you can search and edit with jQuery-style selectors. Developers use it to pull data out of web pages, such as in scrapers, or to modify markup on the server without running a browser. Its description calls it fast, flexible, and elegant, but the README provided here was empty, so details beyond the project description are limited.

  • Extract titles, prices, or links from a saved or downloaded HTML page
  • Parse XML feeds and read specific elements
  • Rewrite or clean up HTML markup in a build or content pipeline

Great for

  • JavaScript developers who already know jQuery-style selectors
  • Writing scripts that extract text or links from static HTML pages
  • Server-side processing of HTML or XML without a browser
  • Building simple web scrapers in Node.js

Not ideal for

  • Pages whose content is filled in by JavaScript after load, because Cheerio works on the HTML it is given and does not run scripts (the README was not available to confirm this, so treat it as a general property of HTML parsers)
  • Non-developers who need a point-and-click scraping tool
  • Projects that need a browser environment with full DOM behavior
Step-by-step guide: how to use CheerioInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js

    Clone the repository

    git clone https://github.com/cheeriojs/cheerio
  2. 2

    Run it

    • Install Cheerio into your project using its package manager (see the project homepage for the exact command).
    • Load an HTML string with the library's load function.
    • Select elements with a jQuery-style selector and read their text or attributes.
    • Check the homepage at cheerio.js.org for the full API reference.
  3. 3

    Get the most out of it

    • Use the documentation at cheerio.js.org for the full list of supported selectors and methods.
    • Pair it with an HTTP client to fetch pages before parsing them.
    • Use it for XML as well as HTML when working with feeds or structured markup.

Downloads

Strengths

  • Familiar jQuery-style API for people who already know jQuery
  • Open source under the MIT license, with a large community (about 30,500 stars)
  • Written in TypeScript, with a published homepage at cheerio.js.org

Trade-offs

  • The README supplied for this review was empty, so setup and feature details could not be verified here
  • It parses markup but does not execute JavaScript, so content rendered client-side will not appear
  • Requires familiarity with JavaScript and HTML structure to use effectively

How it compares

ProjectStarsTypeLevelUpdatedBest for
cheerio (this)30.5kLibrarybeginner4 days agoJavaScript developers who already know jQuery-style selectors
jsoup11.4kLibraryintermediate8 days agoJava developers who need to scrape or extract data from web pages
tui.editor18kLibraryintermediate2.3 years agoWeb developers who want an embeddable Markdown editor in their own site or app
requests-html13.8kLibrarybeginner2.6 years agoPython developers who already use requests and want to parse HTML in the same style
bootstrap175kLibrarybeginner4 days agoDevelopers building responsive websites or web app interfaces quickly
docling70kLibrarybeginner5 days agoPython developers building retrieval or RAG pipelines over PDFs and office files

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.