<table width="100%" border="0" cellpadding="2" cellspacing="0" class="ft12r">
<tbody>
<tr>
<td align="left" class="ft12h">
<a id="pageLink" href="node_4.htm" class="ft12h">第01版:要闻</a>
</td>
<td nowrap align="right" width="16" class="ft12h">
<a href="../../../page/1/2012-03-05/01/8441330887553262.pdf">
<img height="16" src="../../../tplimg/pdf.gif" width="16" border="0"></a>
</td>
</tr>
<tr>
<td align="left" bgcolor="#FEE7B1" class="ft12h">
<a id="pageLink" href="node_5.htm" class="ft12h">第02版:要闻 </a>
</td>
<td width="16" align="middle" nowrap bgcolor="#FEE7B1">
<a href="../../../page/1/2012-03-05/02/38211330879946762.pdf">
<img height="16" src="../../../tplimg/pdf.gif" width="16" border="0" /></a>
</td>
</tr>
</tbody>
</table>
我想取到html里这个table的内容,怎么用正则取到,谢谢
<tbody>
<tr>
<td align="left" class="ft12h">
<a id="pageLink" href="node_4.htm" class="ft12h">第01版:要闻</a>
</td>
<td nowrap align="right" width="16" class="ft12h">
<a href="../../../page/1/2012-03-05/01/8441330887553262.pdf">
<img height="16" src="../../../tplimg/pdf.gif" width="16" border="0"></a>
</td>
</tr>
<tr>
<td align="left" bgcolor="#FEE7B1" class="ft12h">
<a id="pageLink" href="node_5.htm" class="ft12h">第02版:要闻 </a>
</td>
<td width="16" align="middle" nowrap bgcolor="#FEE7B1">
<a href="../../../page/1/2012-03-05/02/38211330879946762.pdf">
<img height="16" src="../../../tplimg/pdf.gif" width="16" border="0" /></a>
</td>
</tr>
</tbody>
</table>
我想取到html里这个table的内容,怎么用正则取到,谢谢
解决方案 »
- ASP.NET 1.1 TextBox问题
- asp.net(关于添加记录时要用到其他表的数据的问题)
- asp.net网页程序引用母版页出错!!希望大哥们指点啊!!在线等待!
- 如何在Page if (!IsPostBack) 中用 new 出来的控件添加到网页的时候,网页提交不用再new 也保持状态 谢谢
- [求助] 通过了Form验证后,普通页面都能正常访问,但用js弹出的页面只要一提交就会跳转回登录页面。
- 有人开发过cms内容管理系统吗?
- GridView返回 问题?
- 问一个很简单的问题win2003下可以不用visual studio.net吗?
- 同一个虚拟目录下的asp和asp.net能否共享session?
- 关于DATAGRID的请教,有3处问题,相信你们一定碰到过
- 大婶救命啊。。在线等
- asp.net 怎么这样弄
string str = File.ReadAllText(@"E:\1.txt", Encoding.GetEncoding("gb2312"));
Regex reg = new Regex(@"(?is)<table[^>]*?class=""ft12r""[^>]*?>(?:.*?<td[^>]*?>(?:\s*<a[^>]*?>\s*)?(.*?)(?:\s*</a>\s*)?</td>)+.*?</table>");
foreach (Match m in reg.Matches(str))
foreach (Capture c in m.Groups[1].Captures)
Console.WriteLine(c.Value);
/*
第01版:要闻
<img height="16" src="../../../tplimg/pdf.gif" width="16" border="0">
第02版:要闻
<img height="16" src="../../../tplimg/pdf.gif" width="16" border="0" />
*/