是否可以通过 HTML class 名称抓取网页?

Is it possible to scrape a webpage by HTML class names?

我正在使用 Jsoup 进行抓取,我只想抓取一些特定的 类。我如何才能只抓取我需要的 类?

如果 "classes" 是指具有特定 class 属性的 html 元素,那么您要做的就是使用您感兴趣的 JSoup to scrape, parse, and tidy the whole page, and then use CSS selectors to grab the elements