日期:2014-05-20 浏览次数:20729 次
<html>
<body>
<table>
<tr>
<td class="sss">
<a href="4.html">444</a>
</td>
<td class="sss">
<a href="5.html">555</a>
</td>
<td class="sss">
<a href="6.html">666</a>
</td>
<td class="sss">
<a href="7.html">777</a>
</td>
</tr>
</table>
</body></html>
Pattern p = Pattern.compile("<td class=\"sss\">.*</td>");
Matcher matcher = p.matcher(str); //str就是上面的那个网页内容
List list = new ArrayList();
while (matcher.find()) {
list.add(matcher.group());
}