步骤

1获取document对象

 

//方法一
Document doc = Jsoup.connect(网址).get()
//方法二
Document doc = Jsoup.parse(html字符串)
//方法三
Document doc = Jsoup.parse(input,UTF8,baseUrl)

 

 

 

2获取Elements对象

//方法一
Elements a = doc.select("这里填写选择器")
//方法二
Elements a = doc.getElementById("")

方法一使用css和Query选择器

方法二使用DOM

 

涉及知识及扩展

Query选择器选取方法

http://www.cnblogs.com/MaxIE/p/4078869.html

Jsoup api文档

https://jsoup.org/apidocs/

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-27
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-02
  • 2022-01-14
  • 2021-08-21
  • 2021-05-07
  • 2021-09-05
  • 2021-06-24
  • 2021-10-16
相关资源
相似解决方案