jsoup v1.10.2 发布
jopen 8年前
<p style="text-align: center;"><strong><img alt="" src="https://simg.open-open.com/show/8ab9c73df2c9fee3fed65a3f9effe89c.jpg" /></strong></p> <p> </p> <p> jsoup 是一款 Java 的HTML 解析器,可直接解析某个URL地址、HTML文本内容。它提供了一套非常省力的API,可通过DOM,CSS以及类似于JQuery的操作方法来取出和操作数据。</p> <p>jsoup的主要功能如下:</p> <ul> <li>从一个URL,文件或字符串中解析HTML;</li> <li>使用DOM或CSS选择器来查找、取出数据;</li> <li>可操作HTML元素、属性、文本;</li> <li>jsoup是基于MIT协议发布的,可放心使用于商业项目。</li> </ul> <h2>更新日志</h2> <ul> <li>Improved startup time, particularly on Android, by reducing garbage generation and CPU execution time when loading he HTML entity files. About 1.72x faster in this area.</li> <li>Added Element.is(query) to check if an element matches this CSS query.</li> <li>Added new methods to Elements: next(query), nextAll(query), prev(query), prevAll(query) to select next and previous element siblings from a current selection, with optional selectors.</li> <li>Added Node.root() to get the topmost ancestor of a Node.</li> <li>Added the new selector :containsData(), to find elements that hold data, like script and style tags.</li> <li>Changed Jsoup.isValid(bodyHtml) to validate that the input contains only body HTML that is safe according to the whitelist, and does not include HTML errors. And in the Jsoup.Cleaner.isValid(Document) method, make sure the doc only includes body HTML.</li> <li><https://github.com/jhy/jsoup/issues/245></li> <li><https://github.com/jhy/jsoup/issues/632></li> <li>In Whitelists, validate that a removed protocol exists before removing said protocol.</li> <li>Allow the Jsoup.Connect thread to be interrupted when reading the input stream; helps when reading from a long stream of data that doesn't read timeout.</li> <li><https://github.com/jhy/jsoup/pull/712></li> <li> Jsoup.Connect now uses a desktop user agent by default. Many developers were getting caught by not specifying the user agent, and sending the default 'Java'. That causes many servers to return different content than what they would to a desktop browser, and what the developer was expecting.</li> <li>Increased the default connect/read timeout in Jsoup.Connect to 30 seconds.</li> <li>Jsoup.Connect now detects if a header value is actually in UTF-8 vs the HTTP spec of ISO-8859, and converts the header value appropriately. This improves compatibility with servers that are configured incorrectly.</li> <li>Bugfix: in Jsoup.Connect, URLs containing non-URL-safe characters were not encoded to URL safe correctly.</li> <li><https://github.com/jhy/jsoup/issues/706></li> <li>Bugfix: a "SYSTEM" flag in doctype tags would be incorrectly removed.</li> <li> <https://github.com/jhy/jsoup/issues/408></li> <li>Bugfix: removing attributes from an Element with removeAttr() would cause a ConcurrentModificationException.</li> <li>Bugfix: the contents of Comment nodes were not returned by Element.data()</li> <li> Bugfix: if source checked out on Windows with git autocrlf=true, Entities.load would fail because of the \r char.</li> </ul> <h2>下载</h2> <ul> <li><a href="/misc/goto?guid=4958997464962081033" rel="nofollow"><strong>Source code</strong> (zip)</a></li> <li><a href="/misc/goto?guid=4958997465059847883" rel="nofollow"><strong>Source code</strong> (tar.gz)</a></li> </ul> <p>本站原创,转载时保留以下信息:<br /> 本文转自:深度开源(open-open.com)<br /> 原文地址:<a href="http://www.open-open.com/news/view/4048f1b0">http://www.open-open.com/news/view/4048f1b0</a></p> <p> </p>