.net抓取网页内容回来怎么用正则匹配出来
.net抓取网页内容回来怎么用正则匹配出来 内容抓回来了 我需要用正则怎么匹配出来里面的内容 求大神
主要代码如下:
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Capture);
//HttpWebRequest请求
request.Headers.Set("Pragma", "no-cache");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream streamReceive = response.GetResponseStream();
Encoding encoding = Encoding.GetEncoding("GB2312");
//StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("gb2312"));
StreamReader streamReader = new StreamReader(streamReceive, encoding);
strResult = streamReader.ReadToEnd(); //strResult是抓取出来的源代码 我需要匹配
}
catch
{
}
return;
------解决方案--------------------http://zhoufoxcn.blog.51cto.com/792419/595344
------解决方案--------------------
你贴点html示例和需要的结果嘛~
------解决方案--------------------
Regex需要using System.Text.RegularExpressions;