日期:2014-05-20  浏览次数:20715 次

网页抓取
谁能给我个 网页抓取工具要有源码

------解决方案--------------------
C#实现网页抓取函数

C# code
private string GetContentFromUrll(string _requestUrl)

        {

            string _StrResponse ="";

            HttpWebRequest _WebRequest = ( HttpWebRequest )WebRequest.Create( _requestUrl );

            _WebRequest.Method = "GET";

            WebResponse _WebResponse = _WebRequest.GetResponse();

            StreamReader _ResponseStream = new StreamReader( _WebResponse.GetResponseStream(), System.Text.Encoding.GetEncoding("gb2312"));

            _StrResponse = _ResponseStream.ReadToEnd();

            _WebResponse.Close(); 

            _ResponseStream.Close();

            return _StrResponse;        

        }