Java開源的HTML 解析器,jsoup 1.8.2 發布

cc68 9年前發布 | 14K 次閱讀 jsoup

jsoup 1.8.2 發布,此版本提升了 Android,HTML 解析,HTML 生成,查詢等方面的性能。同時添加了文件上傳,W3C DOM 互操作等功能,還有其他的改進和 bug 修復。

jsoup 是一款 Java 的HTML 解析器,可直接解析某個URL地址、HTML文本內容。它提供了一套非常省力的API,可通過DOM,CSS以及類似于JQuery的操作方法來取出和操作數據。

jsoup的主要功能如下:

  1. 從一個URL,文件或字符串中解析HTML;

  2. 使用DOM或CSS選擇器來查找、取出數據;

  3. 可操作HTML元素、屬性、文本;

jsoup是基于MIT協議發布的,可放心使用于商業項目。

更新內容

改進

  • 提升 Android 解析 HTML 的性能

  • 提升 Android HTML 序列化的性能

  • 加快 Andorid 上字符集編碼速度

  • 提升 Andorid 上 selector 類的性能

  • 支持文件上傳

  • Add a meta-charset element to documents when setting the character set

  • Added ability to disable TLS (SSL) certificate validation

  • Added ability to further tweak the canned Cleaner Whitelists by removing existing settings.

  • Added option in Cleaner Whitelist to allow linking to in-page anchors (#)

  • Use a lowercase doctype tag for HTML5 documents.

  • Add support for 201 Created with redirect, and other status codes

  • Added support for HTTP method verbs PUT, DELETE, and PATCH.

  • Added support for overriding the default POST character of UTF-8 in Connection.

  • W3C DOM support: added ability to convert from a jsoup document to a W3C document

  • In the HtmlToPlainText example program, added the ability to filter using a CSS selector

  • Improved the equals() and hashcode() methods in Node

  • Improved performance in Selector when searching multiple roots.

Bug 修復

  • Fixed validation of cookie names in HttpConnection cookie methods.

  • Fixed an issue where option tags would be missed when preparing a form for submission if missing a selected attribute.

  • Fixed an issue where submitting a form would incorrectly include radio and checkbox values without the checked attribute.

  • Fixed an issue where Element.classNames() would return a set containing an empty class; and may have extraneous whitespace.

  • Fixed an issue where attributes selected by value were not correctly space normalized.
    In head+noscript elements, treat content as character data, instead of jumping out of head parsing.

  • Fixed performance issue when parsing HTML with elements with many children that need re-parenting.

  • Fixed an issue where a server returning an unsupport character set response would cause a runtime

  • UnsupportedCharsetException, instead of falling back to the default UTF-8 charset.

  • Fixed an issue where Jsoup.Connection would throw an IO Exception when reading a page with zero content-length.

更多內容請看發行說明

來自:http://www.oschina.net/news/61546/jsoup-1-8-2

 本文由用戶 cc68 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!