如何自动采集网页上的数据

RuntimeError 2010-06-15 10:35:02
我在网上搜索说用.NET可以实现类似于采集软件的功能。
比如我想把网上每一期彩票的开奖号码采集下来。某个某个网站上有一个下拉列表,在里面选择期数,然后点击右边的查询,就显示该期的中奖号码。我想把所有的号码都采集下来。这用用C#或者VB.NET是怎么实现的?
...全文
1125 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
blotusland 2011-09-17
  • 打赏
  • 举报
回复
顶下,同求
RuntimeError 2010-06-16
  • 打赏
  • 举报
回复
嗯,很好,谢谢~
hjx398 2010-06-16
  • 打赏
  • 举报
回复
学习了
hhao12 2010-06-16
  • 打赏
  • 举报
回复
顶下。
sxldfang 2010-06-15
  • 打赏
  • 举报
回复
wuyq11 2010-06-15
  • 打赏
  • 举报
回复
HttpWebrequest抓取网页内容,再用正则根据html格式获取数据
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)";
System.Net.WebResponse response = request.GetResponse();
System.IO.Stream resStream = response.GetResponseStream();
System.IO.StreamReader sr = new System.IO.StreamReader(resStream, encoding);
string html = (sr.ReadToEnd());
resStream.Close();
http://topic.csdn.net/u/20090819/10/8b3d325c-5c9e-4e17-b344-a26f13e20aba.html?seed=2057216004&r=59199023

110,571

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧