1.需要下载Jsoup jar包

public final static void parseResume(String fileName) throws IOException {
// 获得document对象
Document document = Jsoup.parse(new File(fileName), "utf-8");
Elements images = document.body().select("ThreadGroup");
Elements rows = images.select("ThreadGroup[guiclass=ThreadGroupGui]");
Elements children=rows.get(0).children();
JSONObject js = new JSONObject();

for(Element child:children ){
//System.out.println(child.attr("name")+"\t"+child.text());
js.put(child.attr("name"),child.text());
}
System.out.println(js);
}

java---获取html中的标签name

 

 

java---获取html中的标签name

 

相关文章:

  • 2022-02-11
  • 2021-05-16
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-12-15
相关资源
相似解决方案