跳转到内容

HTML解析器对比

维基百科,自由的百科全书

这是本页的一个历史版本,由Ma3r留言 | 贡献2014年5月7日 (三) 05:43 (新条目)编辑。这可能和当前版本存在着巨大的差异。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)

Parsing HTML is a automated task, performed by (so called) HTML parsers. They have two main purposes:

  • HTML traversal: offer a interface for programmers to easily access and modify of the "HTML string code". Canonical example: DOM parsers.
  • HTML clean: to fix invalid HTML and to improve the layout and indent style of the resulting markup. Canonical example: HTML Tidy.
Parser License Implementation language(s) Latest date* HTML Parsing[1] Clean HTML** Update HTML***
Beautiful Soup (base on lxml and html5lib)[2] Python S. F. L. Python 2013-05-31 ? ?
Gumbo Apache License 2.0 C (programming language) 2013-08-13 ? ?
html5lib MIT License Python and PHP 2013-12-23[3]
HTML::Parser Perl license Perl 2013-03-28 [4] ? ?
htmlPurifier GNU Lesser GPL PHP 2009-03-25[5]
HTML Tidy W3C license ANSI C 2009-03-25[6] [7] ?
HtmlCleaner BSD License[8] Java 2013-09-05 ?
Hubbub MIT License C (programming language) 2013-04-19 ? ?
Jaunt API Jaunt Beta License Java 2013-08-01
Jericho HTML Parser Eclipse Public License Java 2012-10-30[9] 否?? ? ?
jsdom MIT license JavaScript 2013-07-21 ? ?
jsoup MIT license Java 2013-01-27[10]
JTidy JTidy License Java 2009-12-01[11] ? ?
libxml2 HTMLparser MIT License C (programming language) 2012-09-11[12] ? ?
NekoHTML Apache License 2.0 Java 2013-02-27[13] ? ?
TagSoup Apache License 2.0 Java 2011-07-07 ? ?
Validator.nu HTML Parser MIT License Java 2012-06-05 ? ?
Parser License Implementation language(s) Latest date* HTML Parsing Clean HTML** Update HTML***
* Latest release (of significant changes) date.
** sanitize (generating standard-compatible web-page, reduce spam, etc.) and clean (strip out surplus presentational tags, remove XSS code, etc.) HTML code.
*** Updates HTML4.X to XHTML or to HTML5, converting deprecated tags (ex. CENTER) to valid ones (ex. DIV with style="text-align:center;").

References