你好,游客 登录 注册 搜索
背景:
阅读新闻

jsoup 1.7.1 发布,解析速度提升 2.3 倍

[日期:2012-09-24] 来源:oschina.net  作者:Linux [字体:大 中 小]

jsoup 1.7.1 发布了,下载地址:

jsoup 是一款 Java 的HTML 解析器,可直接解析某个URL地址、HTML文本内容。它提供了一套非常省力的API,可通过DOM,CSS以及类似于JQuery的操作方法来取出和操作数据。

该版本在性能和稳定性方面都有不少提升,功能上也做了改进:

Improvements:

- Improved parse time, now 2.3x faster than previous release, with lower memory consumption.
- Reduced memory consumption and garbage collection when selecting elements.
- Removed an unnecessary synchronisation in Tag.valueOf, allowing multi-threaded parsing to run faster.
- Introduced finer granularity of exceptions in Jsoup.connect, including HttpStatusException and UnsupportedMimeTypeException, allowing programmers better control of error cases.
- In Jsoup.clean, allow custom Document.OutputSettings, to control pretty printing, character set, and entity escaping.
- Whitespace normalise document.title() output.
- In Jsoup.connect, fail faster if the return content type is not supported.
- Made entity decoding less greedy, so that non-entities are less likely to be incorrectly treated as entities.
- In Jsoup.connect, enforce a connection disconnect after every connect. This precludes keep-alive connections to the same host, but in practise many implementations will leak connections, particularly on error.
- If a server doesn't specify a content-type header, treat that as OK.
- If a server returns an unsupported character-set header, attempt to decode the content with the default charset (UTF8), instead of bailing with an unsupported charset exception.
Bug fixes:
- Fixed an issue when determining the Windows-1254 character-set from a meta tag when run in the Turkish locale.
- Fixed whitespace preservation in textarea tags.
- Fixed an issue that prevented frameset documents to be cleaned by the Cleaner.
- Fixed an issue when normalising whitespace for strings containing high-surrogate characters.
linux
相关资讯       jsoup 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款