引入jsoup:
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.16.2</version>
</dependency>
加载网站:
Document document = Jsoup.connect(url).get();
查找class为block的Element:
Elements elements = document.select("[class=block]");
注意:本文归作者所有,未经作者允许,不得转载