curl

Using htmlq to filter web data

Using htmlq to filter web data

Similar to the jq, the htmlq facilitates the filtering of html data. It can be utilized along with the curl command. To filter with id: article-body $ curl -s https://dev.to/anks/using-jq-to-filter-json-data-36c5 | htmlq '#article-body' Enter fullscreen mode Exit fullscreen mode This will filter all codeblocks on a specified dev.to page: $ curl -s https://dev.to/anks/using-jq-to-filter-json-data-36c5 | htmlq '[class="highlight js-code-highlight"]' Enter fullscreen mode Exit fullscreen mode To filter out non-code text from the page: $ curl -s https://dev.to/anks/using-jq-to-filter-json-data-36c5 | htmlq '#article-body>p' <p>Basic Elements</p> <p>n ∉ [0, ∞), int</p> <p>Ex.</p> <p>file.json<br> </p> <p>To filter ids:<br> </p> <p>To return value of <code>name</code> key when id…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.