1、配置

<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.7.3</version>
</dependency>

2、代码
//网站源码
String html = getHtml("www.xxx.com");
System.out.println("官网html:"+html);
Document doc = Jsoup.parse(html);
Elements e_as = doc.getElementsByTag("a");//根据标签名找title元素
for(Element e_a : e_as){
System.out.println(e_a);
System.out.println(e_a.text());//获取标签的文字
}

相关文章:

  • 2022-03-06
  • 2022-12-23
  • 2022-02-08
  • 2022-02-04
  • 2022-12-23
  • 2021-05-07
猜你喜欢
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2021-05-27
  • 2021-06-28
  • 2022-12-23
  • 2021-07-30
相关资源
相似解决方案