Jsoup Source Analysis (i)

Source: Internet
Author: User
Overview

The Jsoup is a Java HTML parser. Supports parsing HTML into a DOM tree, supports CSS selector form selection, supports HTML filtering, and itself comes with an HTTP downloader. Jsoup code Concise, a total of 53 classes, the code about 9000 lines, no third-party dependencies, the code structure is as follows

Jsoup
├──examples #样例, including an example of converting HTML to plain text and one extracting all linked addresses.
├──helper #一些工具类, including tools for reading data, processing connections, and converting strings
├──nodes #DOM节点定义
├──parser #解析html并转换为DOM树
├──safety #安全相关, including whitelist and HTML filtering
└──select #选择器, supports traversal of CSS selector and nodevisitor format

Use

The entrance to the Jsoup is the Jsoup class. First parse the HTML into a DOM tree, using CSS selector and nodevisitor to manipulate DOM elements, as shown in the example code below

Reference: http://my.oschina.net/flashsword/blog/156748

http://jsoup.org/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.