public void loadHtmlFile(String htmlFilePath) { try { Document doc = Jsoup.parse(new File(htmlFilePath), "utf-8"); Elements divs = doc.select("div.hop1"); for (Element div : divs) { System.out.println(div); // 输出: div } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
#####################
标签:标签,htmlFilePath,jsoup,catch,div,divs,class From: https://www.cnblogs.com/herd/p/17758749.html