我现在用ASP.NET+C# 实现一个实例,数据库中存放有URL的ID和地址,还有Text用来存放抓取URL之后过滤一些不必要字符后的字符串。请问具体怎么实现?尽量提供代码,太谢谢了!

解决方案 »

  1.   

    你是不是想找“小偷程序”?http://www.enet.com.cn/article/2004/0825/A20040825337381.shtmlhttp://blog.hnce.net/post/188.htmlhttp://dev.firnow.com/course/4_webprogram/asp.net/asp_netshl/2008324/106230.htmlhttp://www.chinaitweb.com/html/xueshengzhuanqu/net/2009/0529/137.htmlhttp://www.mycodes.net/104/2064.htm
      

  2.   

    建议研究一下,web-harvest一个java开源项目。在oschina.net上就能找到。
      

  3.   

    httpwebrequest,webclient抓取页面数据
    正则根据规则获取
    System.Net.WebClient wc = new System.Net.WebClient();
    Byte[] pageData = wc.DownloadData("");
      string s= System.Text.Encoding.Default.GetString(pageData);
      

  4.   

    谢谢楼上的各位,小弟 现在找到了,但是还有一些问题,其一: 正则获取部分黑体的不正确,大家帮我改下吧;其二:这个程序网页url必须要自己输,如何从数据库读入url地址 并将过滤后的结果输入到数据库中,小弟再次感谢,自己实在是菜鸟,大家能帮帮我吗?感谢
    static void Main(string[] args)
            {
                byte[] buffer = getBytes("http://video.shishicai.cn/haoma/cqssc/list/120.aspx", null, null);
                string html = Encoding.UTF8.GetString(buffer);
                MatchCollection mc = Regex.Matches(html, @"{"(?(([a-z]|[A-Z])+(\d))"}");
               
                
                Console.WriteLine(mc);          
                Console.WriteLine("Close!");
                Console.ReadKey();
            }