类型:笔记本电脑,方法(ParseHtmls) 正则表达式解析(72556) 所用时间: 00:00:05.7500000,写日志的时间:2007-5-15 11:55:34
类型:笔记本电脑,方法(ParseHtmls) 正则表达式解析(72607) 所用时间: 00:00:07.0468750,写日志的时间:2007-5-15 11:56:06
类型:笔记本电脑,方法(ParseHtmls) 正则表达式解析(74500) 所用时间: 00:00:12.0468750,写日志的时间:2007-5-15 12:44:06
==============表达式内容 =================
Regex regexx = new Regex(@ " <td[^> ]*?> (\s*? <[^> ]*?> \s*?)*?(? <content> [^ <> ]*?)(\s*? <[^> ]*?> \s*?)*? </td> ", RegexOptions.IgnoreCase | RegexOptions.Compiled);
MatchCollection mcc = regexx.Matches(htmlStr);
StringBuilder sb = new StringBuilder();
foreach (Match m in mcc)
{
sb.Append(m.Groups[ "content "].Value.Trim() + "÷ ");
}
strR = sb.ToString().Remove(sb.ToString().Length - 1, 1).Replace( "÷÷ ", "÷ ");
===================================
==============解析内容(因为太长先发前部分)======
<TD align= "right " style= "padding-right:10px "> <img src= "http://www.pconline.com.cn/product/images/200606_dian.gif " width= "3 " height= "5 " align= "absmiddle "> <a href= "http://pdlib.pconline.com.cn/product/guest/cavil4Guest.jsp?productId=175286 " target= "_blank "> <font color= "FF8000 "> <b> 我要挑错 </b> </font> </a> </TD> </TR> <TR> <TD CLASS=btd WIDTH=198 BGCOLOR= "#FCFCFC "> <B> <a href= "http://dict.pconline.com.cn/dic/sort.jsp?kindId=-1&dicId=3143 " target= "_blank "> 屏幕尺寸 </a> </B> </TD> <TD ALIGN=left WIDTH=316 BGCOLOR= "#ffffff "> 17寸 </TD> </TR> <TR> <TD CLASS=btd WIDTH=198 BGCOLOR= "#FCFCFC "> <B> <a href= "http://dict.pconline.com.cn/dic/sort.jsp?kindId=-1&dicId=3142 " target= "_blank "> 显示屏类型 </a> </B> </TD> <TD ALIGN=left WIDTH=316 BGCOLOR= "#ffffff "> WUXGA+ </TD> </TR> <TR> <TD CLASS=btd WIDTH=198 BGCOLOR= "#FCFCFC "> <B> 显示屏描述 </B> </TD> <TD ALIGN=left WIDTH=316 BGCOLOR= "#ffffff "> 宽屏,16:10比例,Ultrasharp技术镜面宽屏,分辨率:1920×1200 </TD> </TR> <TR bgcolor= "#eeeeee "> <TD class=article1> <FONT color= "#ff6303 "> <B> 音频视频 </B> </FONT> </TD> <TD align= "right " style= "padding-right:10px "> <img src= "http://www.pconline.com.cn/product/images/200606_dian.gif " width= "3 " height= "5 " align= "absmiddle "> <a href= "http://pdlib.pconline.com.cn/product/guest/cavil4Guest.jsp?productId=175286 " target= "_blank "> <font color= "FF8000 "> <b> 我要挑错 </b> </font> </a> </TD> </TR> <TR> <TD CLASS=btd WIDTH=198 BGCOLOR= "#FCFCFC "> <B> <a href= "http://dict.pconline.com.cn/dic/sort.jsp?kindId=-1&dicId=3132 " target= "_blank "> 显示芯片 </a> </B> </TD> <TD ALIGN=left WIDTH=316 BGCOLOR= "#ffffff "> 独立,nVidia Geforce Go7950GTX </TD> </TR> <TR> <TD CLASS=btd WIDTH=198 BGCOLOR= "#FCFCFC "> <B> <a href= "http://dict.pconline.com.cn/dic/sort.jsp?kindId=-1&dicId=404 " target= "_blank "> 显存容量 </a> </B> </TD> <TD ALIGN=left WIDTH=316 BGCOLOR= "#ffffff "> 512M </TD> </TR> <TR> <TD CLASS=btd WIDTH=198 BGCOLOR= "#FCFCFC "> <B> 显卡性能 </B> </TD> <TD ALIGN=left WIDTH=316 BGCOLOR= "#ffffff "> PCI-E X16接口标准 </TD> </TR>