|
|
|
|
|
by unhammer
4034 days ago
|
|
Don't use awk for parsing XML/JSON, there are excellent tools like html-xml-utils or jq that already do that well: $ sudo apt-get install html-xml-utils jq
$ curl 'https://duckduckgo.com/html/?q=cake' | hxclean \
| hxselect .web-result:first-child .snippet
$ curl apy.projectjj.com/listPairs | jq .responseData[0]
Though I'd typically use Python's BeautifulSoup for anything major with html, there's just too much bad html out there ;) |
|