# htmlq Command-Line HTML Content Extractor with CSS Selectors

> htmlq is a command-line tool for extracting content from HTML using CSS selectors, functioning as the HTML equivalent of jq. Written in Rust, it lets you pipe HTML through CSS selectors to extract text, attributes, and structured content directly from the terminal.

- Skill: `agentskillexchange/htmlq-command-line-html-content-extractor-with-css-selectors` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/htmlq-command-line-html-content-extractor-with-css-selectors`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/htmlq-command-line-html-content-extractor-with-css-selectors/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/htmlq-command-line-html-content-extractor-with-css-selectors

---


# htmlq Command-Line HTML Content Extractor with CSS Selectors

htmlq is a command-line tool for extracting content from HTML using CSS selectors, functioning as the HTML equivalent of jq. Written in Rust, it lets you pipe HTML through CSS selectors to extract text, attributes, and structured content directly from the terminal.

## Prerequisites

Rust (cargo) or Homebrew

## Installation

Use the upstream install or setup path that matches your environment:
- cargo install htmlq
- brew install htmlq

Requirements and caveats from upstream:
- ### Remove a node before output

Basic usage or getting-started notes:
- ### [Cargo](https://crates.io/crates/htmlq)
- sh
- ### [FreeBSD pkg](https://www.freshports.org/textproc/htmlq)

- Source: https://github.com/mgdm/htmlq
- Extracted from upstream docs: https://raw.githubusercontent.com/mgdm/htmlq/HEAD/README.md

## Documentation

- https://github.com/mgdm/htmlq#readme

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/htmlq-command-line-html-content-extractor-css-selectors/)

