pup 介绍
pup 是一个命令行的 HTML 内容解析工具,直接从 stdin 读入内容,并将解析结果输出到 stdout,用户可以使用 CSS 选择器进行内容的过滤。
基本使用方法:
$ 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>
pup 官网
https://github.com/EricChiang/pup
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。