设为首页收藏本站

LUPA开源社区

 找回密码
 注册
文章 帖子 博客
LUPA开源社区 首页 业界资讯 软件追踪 查看内容

jsoup 1.8.3发布,HTML解析器

2015-8-3 22:40| 发布者: joejoe0332| 查看: 474| 评论: 0|原作者: oschina|来自: oschina

摘要: jsoup 1.8.3 发布,此版本主要改进有:解析大型 HTML 文件的一些性能提升;抓取 XML 文档时,自动切换到 XML 解析器;重要 bug 修复。更新内容:改进Performance improvement on parsing larger HTML pages. On Andr ...

jsoup 1.8.3 发布,此版本主要改进有:解析大型 HTML 文件的一些性能提升;抓取 XML 文档时,自动切换到 XML 解析器;重要 bug 修复。

更新内容:

改进

  • Performance improvement on parsing larger HTML pages. On Android KitKat, around 1.7x times faster.

  • On Android Lollipop, ~ 1.3x faster. Improvements largely from re-ordering the HtmlTreeBuilder methods based on analysis of various websites; also from further memory reduction for nodes with no children, and other tweaks.

  • When fetching XML URLs, automatically switch to the XML parser instead of the HTML parser.

  • Improved support for boolean attributes in HTML5.

  • When serialising XML, ensure that '<' characters in attributes are escaped, per spec. Not required in HTML.

Bug 修复

  • Fixed an issue in Element.elementSiblingIndex() (and related methods) where sibling elements with the same content would incorrectly have the same sibling index.

  • Fixed an issue where unexpected elements in a badly nested table could be moved to the wrong location in the document.

  • Fixed an issue where a table nested within a TH cell would parse to an incorrect tree.

  • When serializing a document using the XHTML encoding entities, if the character set did not support &nbsp; chars (such as Shift_JIS), the character would be skipped. For visibility, will now always output &xa0; (the hex code for non-breaking-space); when using XHTML encoding entities (as &nbsp; is not defined), regardless of the output character set.

  • Fixed an issue when resolving URLs, where if the absolute URL had no path, the relative URL was not normalized correctly.

  • Fixed an issue where connections that were redirected to a relative URL did not have the same normalization rules as a URL read from Nodes.absUrl(String).

本站使用 jsoup 来解析 HTML。

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

jsoup的主要功能如下:

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

  2. 使用DOM或CSS选择器来查找、取出数据;

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

jsoup是基于MIT协议发布的,可放心使用于商业项目。


酷毙

雷人

鲜花

鸡蛋

漂亮
  • 快毕业了,没工作经验,
    找份工作好难啊?
    赶紧去人才芯片公司磨练吧!!

最新评论

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187 浙公网安备 33010602006705号   

返回顶部