成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

jsoup 1.6.2發(fā)布 最棒的Java HTML解析器

開發(fā) 后端
jsoup 是一款 Java 的HTML 解析器,可直接解析某個URL地址、HTML文本內(nèi)容。它提供了一套非常省力的API,可通過DOM,CSS以及類似于JQuery的操作方法來取出和操作數(shù)據(jù)。

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

jsoup 1.6.2 發(fā)布了,改版包含很多的 bug 修復(fù),松散的 XML 解析模式,功能調(diào)整以及內(nèi)存的改進(jìn)。

主要改進(jìn)內(nèi)容包括:

- Added a simplified XML parsing mode, which can usefully parse valid and invalid XML, but does not enforce any HTML document structure or special tag behaviour.
- Added the optional ability to track errors when tokenising and parsing.
- Added Jsoup.connect.cookies(Map) method, to set multiple cookies at once, possibly from a prior request.
- Added Element.textNodes() and Element.dataNodes(), to easily access an element's children text nodes and data nodes.
- Added an example program that demonstrates how to format HTML as plain-text, and the use of the NodeVisitor interface.
- Added Node.traverse() and Elements.traverse() methods, to iterate through a node's descendants.
- Updated Jsoup.connect() so that when requests made as POSTs are redirected, the redirect is followed as a GET.
- Updated the Cleaner and whitelists to optionally preserve related links in elements, instead of converting them to absolute links.
- Updated the Cleaner to support custom allowed protocols such as "cid:" and "data:".
- Updated handling of base href tags, to act on only the first one seen when parsing, to align with modern browsers.
- Updated Node.setBaseUri(), to recursively set on all the node's descendants.
Bug fixes:
- Fixed an issue where all HTML parse errors where being tracked as new objects, creating high memory pressure on low-memory devices.
- Fixed handling of null characters within comments.
- Tweaked escaped entity detection in attributes to not treat &entity_... as an entity form.
- Fixed doctype tokeniser to allow whitespace between name and public identifier.
- Fixed issue where comments within a table tag would be duplicate-fostered into body.
- Fixed an issue where a spurious byte-order-mark at the start of a document would cause the parser to miss head contents.
- Fixed an issue where content after a frameset could cause a NPE crash. Now correctly implements spec and ignores the trailing content.
- Tweaked whitespace checks to align with HTML spec.
- Tweaked HTML output of closing script and style tags to not add an extraneous newline when pretty-printing.
- Substantially reduced default memory allocation within Node.outerHtml, to reduce memory pressure when serialising smaller DOMs.

詳情請看官方發(fā)行說明:

http://jsoup.org/news/release-1.6.2

jsoup的主要功能如下:

  1. 從一個URL,文件或字符串中解析HTML;
  2. 使用DOM或CSS選擇器來查找、取出數(shù)據(jù);
  3. 可操作HTML元素、屬性、文本;

jsoup是基于MIT協(xié)議發(fā)布的,可放心使用于商業(yè)項目。

示例代碼:

  1. File input = new File("/tmp/input.html");  
  2. Document doc = Jsoup.parse(input, "UTF-8""http://example.com/");  
  3.  
  4. Element content = doc.getElementById("content");  
  5. Elements links = content.getElementsByTag("a");  
  6. for (Element link : links) {  
  7.   String linkHref = link.attr("href");  
  8.   String linkText = link.text();  

下載地址:http://jsoup.org/download

【編輯推薦】

  1. JActor 2.2.0 RC3發(fā)布 Actor模式的Java實現(xiàn)
  2. LogicalDOC 6.4發(fā)布 Java開源文檔管理系統(tǒng)
  3. Resin 4.0.27發(fā)布 Java應(yīng)用服務(wù)器
  4. LibrePlan 1.2.2發(fā)布 Java開源項目計劃和管理
  5. xmemcached 1.3.6發(fā)布 memcached的Java開發(fā)包
責(zé)任編輯:林師授 來源: 51CTO
相關(guān)推薦

2011-06-17 17:08:03

系統(tǒng)升級錄

2011-12-22 09:03:58

2011-03-15 13:17:08

LinuxopenSUSE 11

2012-03-23 09:26:55

傲游手機(jī)瀏覽器2.5.1發(fā)布

2012-02-14 09:43:49

JavaRSyntaxText

2009-06-21 13:37:53

2011-11-02 17:08:48

OpenBSD發(fā)布

2009-09-27 13:41:55

Eclipse 3.5

2009-02-25 09:35:12

LinuxBASH 4.0OS X v10.4

2012-03-15 16:46:02

JavaMyBatis

2011-06-07 10:07:06

LibreOffice

2011-08-02 09:15:49

LibreOffice

2011-02-24 09:36:33

LibreOffice

2011-12-21 08:58:23

Java

2012-11-14 09:31:13

CloudStackIaaSCitrix

2012-03-15 09:57:59

JavaDynamicRepo

2011-11-21 17:24:13

Java MEJavaSDK

2012-06-17 13:26:07

MongoDBJava

2010-03-24 16:50:53

FreeBSD 7.3

2012-02-13 15:29:32

Python
點贊
收藏

51CTO技術(shù)棧公眾號

主站蜘蛛池模板: 日韩高清在线 | 久久99精品久久久久久国产越南 | 狠狠爱一区二区三区 | 亚洲精品色| 亚洲福利在线观看 | 99视频 | 久久日韩精品 | 亚洲第一av| 亚洲视频1区 | 久久精品视频播放 | 国产精品久久久久久一区二区三区 | 国产女人与拘做受视频 | 国产在线aa | 狠狠草视频| 欧美激情一区二区三区 | 在线观看免费观看在线91 | 精品国产99 | 国产视频黄色 | 婷婷开心激情综合五月天 | 欧美成人综合 | 在线观看黄免费 | 亚洲一区二区三区视频免费观看 | 一级黄色片在线看 | 尤物在线视频 | 国产色婷婷精品综合在线播放 | 欧美mv日韩mv国产网站91进入 | 欧美色专区 | av网站在线播放 | 久久精品二区亚洲w码 | 日韩一区二区三区在线播放 | 欧美日韩久久精品 | 中文字幕一区二区三区四区五区 | 欧美精品一区二区三区在线播放 | 欧美精品一区二区三区在线四季 | 黄色网址在线免费观看 | 欧美日韩亚洲在线 | 日韩中文一区二区三区 | 九九精品影院 | 欧美日韩在线一区二区 | 日韩精品av一区二区三区 | 免费亚洲成人 |