GithubHelp home page GithubHelp logo

xwxiaowei / jsoup-learning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from code4craft/jsoup-learning

0.0 1.0 0.0 1004 KB

Jsoup学习笔记。添加了部分学习代码和注释。

License: MIT License

Java 52.89% HTML 47.11%

jsoup-learning's Introduction

Jsoup学习笔记

Jsoup是Java世界的一款HTML解析工具,它支持用CSS Selector方式选择DOM元素,也可过滤HTML文本,防止XSS攻击。

学习Jsoup是为了更好的开发我的另一个爬虫框架webmagic,为了学的比较详细,就强制自己用很规范的方式写出这部分文章。

代码部分来自https://github.com/jhy/jsoup,添加了一些中文注释以及示例代码。


提纲

  1. 概述

  2. DOM相关对象

  3. Document的输出

  4. HTML语法分析parser

    1. 语法分析与状态机基础
    2. 词法分析Tokenizer
    3. 语法检查及DOM树构建
  5. CSS Selector

  6. 防御XSS攻击

  7. 为Jsoup增加XPath选择功能

    Jsoup默认没有XPath功能,我写了一个项目Xsoup,可以使用XPath来选择HTML文本。Java里较常用的XPath抽取器是HtmlCleaner,Xsoup的性能比它快了一倍。


协议:

相关代码遵循MIT协议。

文档遵循CC-BYNC协议。

Bitdeli Badge

jsoup-learning's People

Contributors

code4craft avatar jhy avatar bitdeli-chef avatar

Watchers

Jay.Xiang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.