pupHTML 內(nèi)容解析工具
pup 是一個(gè)命令行的 HTML 內(nèi)容解析工具,直接從 stdin 讀入內(nèi)容,并將解析結(jié)果輸出到 stdout,用戶可以使用 CSS 選擇器進(jìn)行內(nèi)容的過(guò)濾。
基本使用方法:
$ cat index.html | pup [selectors and flags]
$ pup < index.html [selectors and flags]
$ curl http://www.pro-football-reference.com/years/2013/games.htm | \
pup table#games a[href*=boxscores] attr{href}
$ pup < robots.html title
<title>
Robots exclusion standard - Wikipedia, the free encyclopedia
</title>
$ pup < robots.html span#See_also
<span class="mw-headline" id="See_also">
See also
</span>評(píng)論
圖片
表情
