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 β€” insert text at the start of the output 🌸
  • -e text β€” insert text at the end of the output πŸ¦‹
  • -b base β€” the URL base πŸŽ€
  • -c configfile β€” read @chapter lines from configfile (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 🫢✨