LinuxCommandLibrary

nokogiri

an HTML, XML, SAX, and Reader parser

TLDR

Parse the contents of a URL or file

$ nokogiri [url|path/to/file]
copy


Parse as a specific type
$ nokogiri [url|path/to/file] --type [xml|html]
copy


Load a specific initialization file before parsing
$ nokogiri [url|path/to/file] -C [path/to/config_file]
copy


Parse using a specific encoding
$ nokogiri [url|path/to/file] --encoding [encoding]
copy


Validate using a RELAX NG file
$ nokogiri [url|path/to/file] --rng [url|path/to/file]
copy

DESCRIPTION

Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser. Among Nokogiri’s many features is the ability to search documents via XPath or CSS3 selectors. The nokogiri command parses a document, and launches an interactive ruby session (irb(1)), allowing one to analysing the result interactively.

SYNOPSYS

okogiri [options]

OPTIONS

--type [TYPE] Set the type of the document to be parsed -E, --encoding encoding Set the encoding of the document -e command Specifies script from command-line --rng Validate using this rng file -?, --help Show a message very similar to this man page -v, --version Show the version of the program

EXAMPLES

okogiri http://www.ruby-lang.org/ nokogiri ./public/index.html curl -s http://nokogiri.org | nokogiri -e'p $_.css("h1").length' 2019-08-03 NOKOGIRI(1)

Copied to clipboard