HXEXTRACT(1)
π hxextract β extract selected elements from a HTML or XML file π
okay bestie, welcome to hxextract(1) from the HTML-XML-utils fam π«Ά this is the one that pulls specific lil elements out of your HTML or XML and hands them to you. it's giving "surgical extraction, but make it cute" β¨
β¨ SYNOPSIS β¨
hxextract [ -h | -? ] [ -x ] [ -s text ] [ -e text ] [ -b base ]
element-or-class [ -c configfile | file-or-URL ]
πΈ DESCRIPTION πΈ
so here's the tea: hxextract outputs all elements with a certain name and/or class. all of them. every single one. no gatekeeping π
β οΈ real talk though: the input must be well-formed, because no HTML heuristics are applied. none. zero. it is not gonna hold your hand and fix your broken markup, bestie π
π OPTIONS π
here's everything you can throw at it:
-xβ use XML format conventions. yes queen, switch up the format β¨-s textβ inserttextat the start of the output πΈ-e textβ inserttextat the end of the output π¦-b baseβ the URL base π-c configfileβ read@chapterlines fromconfigfile(those lines have to be of the form"@chapter filename") and extract elements from each of those files. it's giving "batch mode, but make it config file" π-h,-?β print command usage. the classic "help me pls" move π
π OPERANDS π
the operands, the main characters of this whole operation:
element-or-classβ the name of an element to extract (e.g.,"H2"), or the name of a class preceded by.(e.g.,".example"), or a combination of both (e.g.,"H2.example"). pick your fighter βfile-or-URLβ a file name or a URL. wanna read from standard input? use"-"π
π ENVIRONMENT π
tryna use a proxy to retrieve remote files? set the environment variables http_proxy and ftp_proxy. for example:
http_proxy="http://localhost:8080/"
slay, now you're tunneling through π§
π BUGS π
okay so, the not-so-iconic parts, we're keeping it real:
- remote files (the ones specified with a URL) are currently only supported for HTTP. periodt.
- password-protected files, or files that depend on HTTP
"cookies", are not handled. nope. not even a little. π - > but bestie, you can use tools such as curl(1) or wget(1) to retrieve such files. werk around it π
π₯ SEE ALSO π₯
- hxselect(1) β go say hi, it's the sibling β¨
and that's the whole vibe check! this page is from HTML-XML-utils, version 7.x, dated 10 Jul 2011 β so yes, she's a lil vintage, but she still eats π stay well-formed out there, bestie π«Άβ¨
π¦ where this page comes from
- alpine 3.24: html-xml-utils-doc 8.7-r0 Β· W3C
- arch rolling: html-xml-utils 8.8-1 Β· W3C
- debian bookworm: html-xml-utils 7.7-1.1 Β· W3C
- debian trixie: html-xml-utils 7.7-1.1+b1 Β· W3C
- fedora 43: html-xml-utils 8.6-2.fc41 Β· W3C AND BSD-3-Clause
- fedora 44: html-xml-utils 8.7-1.fc44 Β· W3C AND BSD-3-Clause
- nixos 26.05: html-xml-utils 8.7
- nixpkgs unstable: html-xml-utils 8.7
- opensuse-leap 16.0: html-xml-utils 8.6-bp160.1.12 Β· W3C
- opensuse-leap 16.0: html-xml-utils 8.6-bp160.1.12 Β· W3C
- opensuse-leap 16.0: html-xml-utils 8.6-bp160.1.12 Β· W3C
- opensuse-leap 16.0: html-xml-utils 8.6-bp160.1.12 Β· W3C
- ubuntu jammy: html-xml-utils 7.7-1.1 Β· W3C
- ubuntu noble: html-xml-utils 7.7-1.1build2 Β· W3C
- ubuntu questing: html-xml-utils 7.7-1.1build2
- ubuntu resolute: html-xml-utils 7.7-1.3 Β· W3C
- ubuntu stonking: html-xml-utils 7.7-1.3 Β· W3C
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms