Welcome to Cheerio! | cheerio - JS. ORG Cheerio parses markup and provides an API for traversing manipulating the resulting data structure It does not interpret the result as a web browser does Specifically, it does not produce a visual rendering, apply CSS, load external resources, or execute JavaScript which is common for a SPA (single page application)
Manipulating the DOM | cheerio - JS. ORG In this guide, we will focus specifically on manipulating elements within a document using Cheerio We will cover methods for modifying element attributes and properties, adding and removing classes, modifying text and HTML content, inserting and removing elements, and handling errors and debugging
Class: abstract Cheerio lt;T gt; - JS. ORG The cheerio class is the central class of the library It wraps a set of elements and provides an API for traversing, modifying, and interacting with the set Loading a document will return the Cheerio class bound to the root element of the document
Selecting Elements | cheerio - JS. ORG Cheerio allows users to select elements from an HTML document using CSS selectors This allows you to select elements based on criteria such as their tag name, class name, and attribute values This guide provides an overview of how to use CSS selectors to retrieve elements
Loading Documents | cheerio - JS. ORG The load method is the most basic way to parse an HTML or XML document with Cheerio It takes a string containing the document as its argument and returns a Cheerio object that you can use to traverse and manipulate the document
Extracting Data with the extract Method | cheerio - JS. ORG This uses Cheerio's prop method under the hood value defaults to textContent , which extracts the text content of the element As an attribute with special logic inside the prop method, href s will be resolved relative to the document's URL
Interface: CheerioAPI() | cheerio - JS. ORG Parses a string into an array of DOM nodes The context argument has no meaning for Cheerio, but it is maintained for API compatibility with jQuery Parameters this CheerioAPI data? Markup that will be parsed null | "" Returns null The parsed DOM Alias Cheerio parseHTML See https: api jquery com jQuery parseHTML Inherited from
Cheerio 1. 0 Released, Batteries Included | cheerio Cheerio 1 0 is out! After 12 release candidates and just a short seven years after the initial 1 0 release candidate, it is finally time to call Cheerio 1 0 complete The theme for this release is "batteries included", with common use cases now supported out of the box
Traversing the DOM | cheerio - JS. ORG Traversing a document with Cheerio allows you to select and manipulate specific elements within the document Whether you want to move up and down the DOM tree, move sideways within the tree, or filter elements based on certain criteria, Cheerio provides a range of methods to help you do so