标签:while mamicode src iter tcl -- size att html
List list = new ArrayList();
Document document = Jsoup.parse(new File("E:\\test\\erp_index.html"), "UTF-8");
final Elements bookname = document.getElementsByClass("bookname");
final Elements bookzz = document.getElementsByClass("bookzz");
final Elements bookjs = document.getElementsByClass("bookjs");
final Elements bookbtn = document.getElementsByClass("bookbtn");
for (int i = 0; i < bookname.size(); i++) {
String s = bookname.get(i).select("a").attr("href");
LogUtil.info(bookname.get(i).text() + "," + bookzz.get(i).text() + "," + bookbtn.get(i).text());
list.add(new ClientVersion(bookbtn.get(i).text(), bookname.get(i).text()+"<-->"+s));
}
LogUtil.info("一共多少:" + bookname.size());
Collections.sort(list, new Comparator<ClientVersion>() {
@Override
public int compare(ClientVersion o1, ClientVersion o2) {
Comparator<Object> compare = Collator.getInstance(java.util.Locale.CHINA);
return ((Collator) compare).compare(o1.getClient(), o2.getClient());
}
});
final Iterator iterator = list.iterator();
while (iterator.hasNext()) {
final ClientVersion next = (ClientVersion)iterator.next();
LogUtil.info(next.getClient() + "-->" + next.getClientVersion());
}
标签:while mamicode src iter tcl -- size att html
原文地址:https://blog.51cto.com/357712148/2421897