skillfed

cheerio-parsing

cheerio-parsing teaches you how to parse and extract structured data from HTML and XML documents using Cheerio's jQuery-like API. This skill covers selecting elements, traversing the DOM, and transforming document content for web scraping, data extraction, and content processing workflows.

cheerio-parsing teaches you to load HTML documents into Cheerio using its jQuery-like API, then select and manipulate elements just as you would in a browser. You load your HTML string or file with cheerio.load(), then use familiar CSS selectors and DOM methods to access and extract the data you need from the parsed structure.

AI-generated summary based on this skill's SKILL.md

202 30 Apache-2.0 updated by Mindrally

Install

Mindrally/skills/cheerio-parsing

CLI (skillfed)coming soon
git clone https://github.com/Mindrally/skills
cp -r skills/cheerio-parsing ~/.claude/skills/cheerio-parsing

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I parse HTML with cheerio?

cheerio-parsing teaches you to load HTML documents into Cheerio using its jQuery-like API, then select and manipulate elements just as you would in a browser. You load your HTML string or file with cheerio.load(), then use familiar CSS selectors and DOM methods to access and extract the data you need from the parsed structure.

What are the main techniques for DOM traversal in Cheerio?

cheerio-parsing covers DOM traversal techniques including parent(), children(), siblings(), find(), and next()/prev() methods that let you navigate the document tree. These methods work alongside CSS selectors to help you locate and extract specific elements and their content from your HTML or XML documents.

How can I extract table data using cheerio?

cheerio-parsing shows you how to select table rows and cells with CSS selectors like 'tr' and 'td', then iterate through them to extract structured data. You can use methods like .text(), .html(), and attribute selectors to pull values from each cell, making it straightforward to convert HTML tables into arrays or objects for further processing.

What does cheerio-parsing teach about handling missing elements?

cheerio-parsing addresses edge cases and error handling by showing you how to safely check for element existence before accessing properties. Techniques include validating selector results, using conditional checks, and implementing fallback values so your extraction workflows remain robust when HTML structures vary or expected elements are absent.

How do I optimize cheerio scraping for performance and memory efficiency?

cheerio-parsing covers performance optimization strategies such as using specific CSS selectors to reduce DOM traversal overhead, processing large documents in chunks, and releasing references to free memory. Best practices include avoiding unnecessary re-parsing, reusing Cheerio instances, and structuring your scraping pipeline to handle large-scale data collection without memory bloat.

Can cheerio-parsing help me build web scraping pipelines with cheerio for automated data collection?

cheerio-parsing teaches you to construct complete web scraping pipelines by combining HTML parsing with data extraction workflows. You learn to parse fetched content, select and transform data using CSS selectors and DOM methods, handle pagination, and organize extracted results—enabling you to automate data collection from multiple pages or sources efficiently.

SKILL.md

rendered from the published skill — quoted content, verbatim

Cheerio HTML Parsing

You are an expert in Cheerio, Node.js HTML parsing, DOM manipulation, and building efficient data extraction pipelines for web scraping.

Core Expertise

  • Cheerio API and jQuery-like syntax
  • CSS selector optimization
  • DOM traversal and manipulation
  • HTML/XML parsing strategies
  • Integration with HTTP clients (axios, got, node-fetch)
  • Memory-efficient processing of large documents
  • Data extraction patterns and best practices

Key Principles

  • Write clean, modular extraction functions
  • Use efficient selectors to minimize parsing overhead
  • Handle malformed HTML gracefully
  • Implement proper error handling for missing elements
  • Design reusable scraping utilities
  • Follow functional programming patterns where appropriate

Basic Setup

npm install cheerio axios
Loading HTML

```javascript const cheerio = require('cheerio'); const axios = require('axios');

// Load from string const $ =

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 1 file
cheerio-parsing/SKILL.md

Related skills

Tags

web-scraping-library dom-query-engine data-extraction-tool server-side-parsing css-selector-support jquery-like-api node-ecosystem content-harvesting pipeline-automation