Get started with cheerio CDN
MIT licensed
Fast, flexible library for HTML/XML parsing and manipulation: Cheerio.
Tags:- htmlparser
- jquery
- selector
- scraper
- parser
- html
Stable version
Copied!
How to start using cheerio CDN
const cheerio = require('cheerio/src/cheerio');
const $ = require(' cheerio ').default;
// Fetch the HTML content using axios or any other library
const htmlContent = `
<html>
<head>
<title>Get started with cheerio CDN - cdnhub.io</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
`;
// Load the HTML content into Cheerio
const $cheerioHtml = $(htmlContent);
// Manipulate the HTML using Cheerio
$cheerioHtml('h1').text('Hello Cheerio!');
// Get the modified HTML as a string
const modifiedHtml = $cheerioHtml.html();
console.log(modifiedHtml); // Output: <html>...</html> with 'Hello Cheerio!' as the h1 text
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!