LinuxCommandLibrary

nokogiri

ruby HTML/XML parser CLI

TLDR

Parse HTML file

$ nokogiri [file.html]
copy
Fetch and parse URL
$ nokogiri [https://example.com]
copy
Parse with CSS selector
$ nokogiri [file.html] -e "[doc.css('h1').text]"
copy
Parse XML
$ nokogiri [file.xml] --type xml
copy
Interactive mode
$ nokogiri [file.html] -i
copy

SYNOPSIS

nokogiri [options] [fileorurl]

DESCRIPTION

nokogiri is a Ruby HTML/XML parser CLI. It provides document parsing and querying.
The tool uses CSS and XPath selectors. Part of the Nokogiri Ruby gem.

PARAMETERS

FILEORURL

HTML/XML file or URL.
-e CODE
Execute Ruby code.
--type TYPE
Document type (html, xml).
-i
Interactive mode (irb).
--help
Display help information.

CAVEATS

Requires Ruby. Nokogiri gem must be installed. Ruby syntax for expressions.

HISTORY

Nokogiri is a Ruby gem for parsing HTML/XML, with this CLI wrapper for quick operations.

SEE ALSO

xmllint(1), pup(1), xidel(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community