![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
jsoup官方教程
文章平均质量分 64
iteye_1599
这个作者很懒,什么都没留下…
展开
-
解析和遍历文档
[b]To parse a HTML document(解析一个html文档):[/b] [code="java"]String html = "First parse" + "Parsed HTML into a doc."; Document doc = Jsoup.parse(html);[/code] (See parsing a document from a strin...原创 2012-08-12 21:19:19 · 87 阅读 · 0 评论 -
Parse a document from a String(将一个字符串解析成文档对象)
[size=large]Problem[/size] You have HTML in a Java String(你有一个java字符串格式的html), and you want to parse that HTML to get at its contents(和 你需要解析这个html获得他的内容), or to make sure it's well formed(或者确保他是格式良好...原创 2012-08-13 21:44:35 · 140 阅读 · 0 评论 -
Parsing a body fragment
[size=large]Problem(问题)[/size] You have a fragment of body HTML (你有一个html片段)(e.g. a div containing a couple of p tags; as opposed to a full HTML document (不是完整的html)) that you want to parse(需要你解析). P...原创 2012-08-15 23:13:32 · 177 阅读 · 0 评论 -
Load a Document from a URL(从一个url中加载文档)
[size=large]Problem(解决)[/size] You need to fetch and parse a HTML document from the web(你需要从一个url地址获得并解析html文档), and find data within it (并在里面搜索数据)(screen scraping抓取数据). [size=large]Solution(解决)[/...原创 2012-08-16 21:59:57 · 123 阅读 · 0 评论 -
Load a Document from a File(从一个文件中加载文档)
[size=large]Problem[/size] You have a file on disk that contains HTML(你有一个文件他包含html), that you'd like to load and parse(你想加载并解析它), and then maybe manipulate or extract data from(并操作的它或者获得他的数据). [s...原创 2012-08-17 07:07:29 · 133 阅读 · 0 评论 -
Use DOM methods to navigate a document(使用DOM方法来操纵文档)
[size=large]Problem[/size] You have a HTML document that you want to extract data from(你想从一个html文件中提取数据). You know generally the structure of the HTML document(你知道html的结构). [size=large]Solution[/s...原创 2012-08-18 20:13:15 · 123 阅读 · 0 评论