dev-resources.site
for different kinds of informations.
Using htmlq to filter web data
Published at
8/18/2024
Categories
htmlq
html
curl
filter
Author
anks
Author
4 person written this
anks
open
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'
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"]'
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 is 1<br>
</p>
<p>To filter ids as json<br>
</p>
<p>Ref. :<br>
<a href="https://stedolan.github.io/jq/">https://stedolan.github.io/jq/</a><br>
<a href="https://programminghistorian.org/en/lessons/json-and-jq">https://programminghistorian.org/en/lessons/json-and-jq</a></p>
To filter out non-code text from the page and to return the output in text format:
$ curl -s https://dev.to/anks/using-jq-to-filter-json-data-36c5 | htmlq -t '#article-body>p'
Basic Elements
n â [0, â), int
Ex.
file.json
To filter ids:
To return value of name key when id is 1
To filter ids as json
Ref. :
https://stedolan.github.io/jq/
https://programminghistorian.org/en/lessons/json-and-jq
curl Article's
30 articles in total
How to Ignore cURL SSL Errors
read article
How to Use cURL to Download Files?
read article
Unlocking the Power of cURL Set Headers for Web Development
read article
The Essential Guide to cURL Set Headers for Developers
read article
What is HTTP 405 Error? (Method Not Allowed)
read article
Boost Your Network Control with Curl SOCKS5 Proxies
read article
How to Use cURL GET Requests
read article
Unlock Efficient IP Management with Curl Proxy
read article
How Does Curl Work and Enhance File Transfers Across Platforms
read article
How Does Curl Work to Simplify Data Transfers and Testing
read article
cURL vs Wget: Key Differences Explained
read article
How to Make DELETE Requests Using the curl_init() Function in PHP
read article
Using htmlq to filter web data
currently reading
Harder HTB: Using only the terminal
read article
Vault CLI in Containers
read article
How to Route cURL Requests Through a Proxy Server
read article
TLS Fingerprint äŋč·įįķēįŦ
read article
Manage Telegram Webhooks Using curl
read article
Introducing CurlDock: Simplify API Testing with Docker and Curl
read article
CURL - All methods and Usage â
read article
uploading to s3 with bash
read article
Curl on FTP
read article
Build your own curl in Golang
read article
Build Your Own curl - Rust
read article
Download file using curl
read article
How to Use cURL For Web Scraping
read article
Maintain a Healthy Sense of Caution Whenever Running a `curl|bash` Command
read article
How to Use a Proxy in PHP with cURL
read article
Curl: Redirect output to file
read article
How to use cURL in PHP
read article
Featured ones: