+++ date = "2022-09-28T02:36:11+00:00" lastmod = "2022-09-28T02:37:11+00:00" tags = [ "gists" ] author = "tdro" +++ Chrome [`--headless`](https://peter.sh/experiments/chromium-command-line-switches/#headless) can dump the {{< abbr dom "document object model" >}} to the [command](https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md#chrome-flags-for-tooling) line. Set a virtual time budget in {{< abbr vms "virtual milliseconds" >}} [[?](https://github.com/chromium/chromium/blob/e5b65ca9b408d525f787a946448b206f7f81cca9/headless/app/headless_shell_switches.cc#L122)] for the {{< abbr js "javascript" >}} to settle down and then do stuff. ```shell Html() { chromium \ --headless \ --incognito \ --dump-dom \ --virtual-time-budget=999999 \ "$1" } HtmlToText() { lynx -stdin -dump -nolist } ``` This has "peculiar" uses. Fun fact: invoking the name of [chromium](https://www.chromium.org/Home/) around normal people confers alien--like status. ```shell Html 'https://www.youtube.com/' | HtmlToText ```