80,358
社区成员
发帖
与我相关
我的任务
分享
Document doc = null;
Elements elements = null;
String html="<table cellspacing=\"0\" cellpadding=\"0\" width=\"98%\" border=\"0\">";
html+="<tbody>";
html+="<tr>";
html+="<td colspan=\"3\" class=\"listTitle\" style=\"text-align: left; border-bottom: 1px #999999 solid;";
html+=" margin-top: 10px; line-height: 30px; vertical-align: 80%;\">";
html+=" 通知公告";
html+="</td>";
html+="</tr>";
html+=" <!--列表部分-->";
html+="<tr>";
html+="<td class=\"line\" align=\"center\" valign=\"top\" width=\"4%\" style=\"border-bottom: #a0a0a0 1px dashed;";
html+=" line-height: 25px\">";
html+="<img src=\"../../content/images/main_07.jpg\" style=\"vertical-align: top;\" />";
html+="</td>";
html+="<td align=\"left\" style=\"border-bottom: #a0a0a0 1px dashed; line-height: 25px\">";
html+="<a class=\"LinkStyle\" target=\"_blank\" href=\"/home/detail/3b110e4b-a918-419b-86d7-73221739b6da\">";
html+="第三届北京市大学生书法大赛校内预选赛通知</a>";
html+="</td>";
html+="<td align=\"left\" valign=\"top\" width=\"80px\" style=\"border-bottom: #a0a0a0 1px dashed;";
html+="line-height: 25px\">";
html+="[14.03.07]";
html+=" </td>";
html+="</tr>";
html+="<!-- 列表结束-->";
html+="<tr>";
html+="<td class=\"line\" align=\"center\" valign=\"top\" width=\"4%\" style=\"border-bottom: #a0a0a0 1px dashed;";
html+="line-height: 25px\">";
html+=" <img src=\"../../content/images/main_07.jpg\" style=\"vertical-align: top;\" />";
html+="</td>";
html+="<td align=\"left\" style=\"border-bottom: #a0a0a0 1px dashed; line-height: 25px\">";
html+="<a class=\"LinkStyle\" target=\"_blank\" href=\"/home/detail/58955942-a526-4805-9026-5b511af26d8d\">";
html+="第五期人际关系体验及成长小组招募(仅限雁栖湖校区)</a>";
html+="</td>";
html+="<td align=\"left\" valign=\"top\" width=\"80px\" style=\"border-bottom: #a0a0a0 1px dashed;";
html+="line-height: 25px\">";
html+="[14.02.26]";
html+="</td>";
html+="</tr>";
html+="<!-- 列表结束-->";
html+="<tr>";
html+="<td class=\"line\" align=\"center\" valign=\"top\" width=\"4%\" style=\"border-bottom: #a0a0a0 1px dashed;";
html+="line-height: 25px\">";
html+="<img src=\"../../content/images/main_07.jpg\" style=\"vertical-align: top;\" />";
html+="</td>";
html+="<td align=\"left\" style=\"border-bottom: #a0a0a0 1px dashed; line-height: 25px\">";
html+="<a class=\"LinkStyle\" target=\"_blank\" href=\"/home/detail/1945d023-b211-43d5-bdac-7f01169342f7\">";
html+=" 第四期人际关系体验及成长小组招募</a>";
html+="</td>";
html+="<td align=\"left\" valign=\"top\" width=\"80px\" style=\"border-bottom: #a0a0a0 1px dashed;";
html+=" line-height: 25px\">";
html+=" [14.02.26]";
html+="</td>";
html+="</tr>";
html+="</tbody>";
html+="</table>";
doc = Jsoup.parse(html) ;
elements = doc.select("table tr td:gt(1)");
for (Element p : elements) {
System.out.println(p.parent().select("td a").attr("href")+"-->"+p.parent().select("td a").text()+"---->"+p.parent().select("td:eq(2)").text());
}