求asp.net爬虫源代码 求asp.net爬虫源代码,能够生成sitemap.xml和sitemap.html 请大家帮忙? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.codeplex.com/site/search?ProjectSearchText=spider http://www.codeplex.com/noodle,这个是我写的,功能还不是很完善,而且只能爬一层. 完整的爬虫楼主还是看这个吧.http://www.cnblogs.com/torome/articles/364774.html httpwebrequest网站首页,然后得到的流READTOEND,形成字符串,然后进行对字符串的解析。有的网站一般站点地图和菜单项匹配的。 然后再动态生成xml或根据xsl转换工具转换成相应html。 用webrequest WebRequest Wrq = WebRequest.Create(要爬的地址); WebResponse Wrs = Wrq.GetResponse(); Stream strm = Wrs.GetResponseStream(); StreamReader sr = new StreamReader(strm, System.Text.Encoding.GetEncoding("UTF-8")); string allstrm; allstrm = sr.ReadToEnd(); string strPattern = @"要抓东西的正则"; MatchCollection Matches = Regex.Matches(allstrm, strPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); foreach (Match NextMatch in Matches) { 得到结果 = NextMatch.Groups[0].Value.ToString().Trim(); }然后你把结果生成XML文件就可以了,写个方法带参数的。 5000分,我送上源码,C#开发,winform的,是自己写的用来爬邮件的,多线程, 好jian,没晓得现在流行什么?开源! lucence是爬虫?那个不是吧!!! 产品类型达到的、三级或者三级以上改怎么修改? 最新面试问题,高手请进!网络和3个桶装水问题 一个关于access很奇怪的问题 如何让ie在 关闭 时弹出另一个页面 asp.net中如何给控件取带变量的名字?快晕死了! 输入字符串的格式不正确。怎么办啊~!!! 如何可以让表格满屏显示? 我在本地机器上用vs.net写了个程序,但发布到web服务器上就报错,请高手指点。谢谢 DataTable作为函数参数的怪问题,请指点! 请教一个比较菜的问题! 如何通过ip来限制访问者浏览权限??? 请教“设计视图不支持创建或编辑框架集”
http://www.cnblogs.com/torome/articles/364774.html
有的网站一般站点地图和菜单项匹配的。
WebResponse Wrs = Wrq.GetResponse();
Stream strm = Wrs.GetResponseStream();
StreamReader sr = new StreamReader(strm, System.Text.Encoding.GetEncoding("UTF-8"));
string allstrm;
allstrm = sr.ReadToEnd();
string strPattern = @"要抓东西的正则";
MatchCollection Matches = Regex.Matches(allstrm, strPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
foreach (Match NextMatch in Matches)
{
得到结果 = NextMatch.Groups[0].Value.ToString().Trim();
}然后你把结果生成XML文件就可以了,写个方法带参数的。