# phpman > man > NOKOGIRI(1)

> **TLDR:** An HTML, XML, SAX, and Reader parser.
>
- Parse the contents of a URL or file:
  `nokogiri {{url|path/to/file}}`
- Parse as a specific type:
  `nokogiri {{url|path/to/file}} --type {{xml|html}}`
- Load a specific initialization file before parsing:
  `nokogiri {{url|path/to/file}} -C {{path/to/config_file}}`
- Parse using a specific encoding:
  `nokogiri {{url|path/to/file}} {{-E|--encoding}} {{encoding}}`
- Validate using a RELAX NG file:
  `nokogiri {{url|path/to/file}} --rng {{url|path/to/file}}`

*Source: tldr-pages*

---

[NOKOGIRI(1)](https://www.chedong.com/phpMan.php/man/NOKOGIRI/1/markdown)                                                                              [NOKOGIRI(1)](https://www.chedong.com/phpMan.php/man/NOKOGIRI/1/markdown)



## NAME
       nokogiri - an HTML, XML, SAX, and Reader parser

## 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)](https://www.chedong.com/phpMan.php/man/irb/1/markdown)), allowing one to analysing the
       result interactively.

## SYNOPSYS
       **nokogiri** <_uri_|_path_> [_options_]

## OPTIONS
       **--type** [_TYPE_]
           Set the type of the document to be parsed

### -E --encoding
           Set the encoding of the document

### -e
           Specifies script from command-line

       **--rng** <_uri_|_path_>
           Validate using this rng file

       **-?**, **--help**
           Show a message very similar to this man page

### -v --version
           Show the version of the program

## EXAMPLES
       nokogiri <http://www.ruby-lang.org/>

       nokogiri ./public/index.html

       curl -s <http://nokogiri.org> | nokogiri -e'p $_.css("h1").length'



                                             2022-01-27                                  [NOKOGIRI(1)](https://www.chedong.com/phpMan.php/man/NOKOGIRI/1/markdown)
