Why not incorporate this into jq itself, like perhaps adding some command line arguments to switch to HTML mode?
Htmlq: like jq, but for html
71–80 of 172 posts
Re: Htmlq: like jq, but for html
#72From examples, this is only like jq in the sense that the q stands for the same thing. Even the way it does that is different. An xmlq that was really like jq would be fun, about 20 years ago.
There is `xq` today, which parses XML like `jq`. I think that it is relatively unknown because it is part of the `yq` package for parsing YMAL. So just install `yq` via PIP and you'll get `xq` as well. There is also `xmlstarlet` for parsing XML in a similar fashion.
Re: Htmlq: like jq, but for html
#73Maybe call it hq ?
Re: Htmlq: like jq, but for html
#74Re: Htmlq: like jq, but for html
#75"jq is like sed for JSON data"
sed: "While in some ways similar to an editor which permits scripted edits (_such as ed_), sed works by making only one pass over the input(s)"
ed: "ed is a line-oriented text editor".
Software definition through a reference to another software is somewhat confusing. Potential users come from different backgrounds (I had no idea what is jq), and it is not clear what are the defining features of each project. Is jq line oriented? Is htmlq operating in a single pass?
Re: Htmlq: like jq, but for html
#76If you make the html well formed, xpath also works great. Great stuff if you ever need to pick html apart. Used this quite a bit when microformats were still a thing together with jtidy. Jq is very loosely inspired by that, I guess. Might come full circle here and use some XSL transformations ...
I made a tool that extracted parts of web pages 10-15 years ago, and it worked well. There are of course cases where the html is so unstructured that the results were unpredictable, but it worked well in general.
Re: Htmlq: like jq, but for html
#77I hope we standardize on some jq query language, like we have with a base set of SQL syntax
Re: Htmlq: like jq, but for html
#78"htmlq: like jq, but for HTML" "jq is like sed for JSON data" sed: "While in some ways similar to an editor which permits scripted edits (_such as ed_), sed works by making only one pass over the input(s)" ed: "ed is a line-oriented text editor". Software definition through a reference to another software is somewhat confusing. Potential users come from different backgrounds (I had no idea what is jq), and it is not…
Re: Htmlq: like jq, but for html
#79Re: Htmlq: like jq, but for html
#80"htmlq: like jq, but for HTML" "jq is like sed for JSON data" sed: "While in some ways similar to an editor which permits scripted edits (_such as ed_), sed works by making only one pass over the input(s)" ed: "ed is a line-oriented text editor". Software definition through a reference to another software is somewhat confusing. Potential users come from different backgrounds (I had no idea what is jq), and it is not…
You know Jimmy the famous mechanic? I'm Timmy, _his brother_ but an electrician.
IMO, at least `jq` has proven itself as the indispensable tool for json-data manipulation.