LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

xidel

HTML/XML/JSON data extraction tool

TLDR

Extract with XPath
$ xidel [file.html] -e "//title"
copy
Extract from URL
$ xidel [https://example.com] -e "//h1"
copy
CSS selector
$ xidel [file.html] --css "div.content"
copy
Extract JSON
$ xidel [file.json] -e "$json/key"
copy
Multiple extractions
$ xidel [file.html] -e "//title" -e "//h1"
copy
Output JSON
$ xidel [file.html] -e "//a/@href" --output-format=json
copy
Follow links
$ xidel [url] -f "//a/@href" -e "//title"
copy

SYNOPSIS

xidel [-e expression] [--css selector] [options] input

DESCRIPTION

xidel is a command-line tool for extracting and querying data from HTML, XML, and JSON documents. It supports multiple query languages including XPath, XQuery, and CSS selectors, making it versatile for a wide range of data extraction tasks from both local files and remote URLs.XPath and XQuery expressions allow precise navigation of document structure, while CSS selectors provide a familiar syntax for those accustomed to web development. For JSON documents, xidel uses a path-based syntax to navigate object hierarchies. Multiple extraction expressions can be combined in a single invocation for complex data gathering.The tool includes a link-following mode that enables web spidering, where xidel can traverse links on pages and apply extraction expressions to each visited page. Output can be formatted as plain text, JSON, or other structured formats, making it suitable for integration into data processing pipelines.

PARAMETERS

-e, --extract EXPR

XPath/XQuery expression.
--css SELECTOR
CSS selector.
-f, --follow EXPR
Follow links.
--output-format FORMAT
Output format.
--input-format FORMAT
Input format.
-s, --silent
Suppress status.
--user-agent UA
User agent.

INSTALL

brew install xidel
copy
nix profile install nixpkgs#xidel
copy

CAVEATS

Complex syntax learning curve. Large documents may be slow. Encoding issues possible.

HISTORY

xidel was created as a powerful command-line data extraction tool. It combines multiple query languages in one utility.

SEE ALSO

xmllint(1), jq(1), pup(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid