是的,存在这种问题,抓google是一样的。要么你用vpn之类的换IP抓取吧

解决方案 »

  1.   


    httprequsert.proy 启用代理  免费代理自己可以百度一下
      

  2.   

    public static string GetHtml(string url, string ip, int port)
            {
                string html = "";
                try
                {   //设置代理IP
                    WebProxy proxy = new WebProxy(ip, port);
                    HttpWebRequest request = (HttpWebRequest)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)";
                    request.Proxy = proxy;
                    request.Timeout = 30000;
                    WebResponse response = request.GetResponse();
                    Stream resStream = response.GetResponseStream();
                    StreamReader sr = new StreamReader(resStream);
                    // html.Append(sr.ReadToEnd());
                    resStream.Close();
                    sr.Close();
                    html = "Y";
                }
                catch (System.Exception ex)
                {
                    html = ex.Message;
                }
                return html;
            }
      

  3.   


    我擦 你会引用不string html=GetHtml("http://www.baidu.com"+关键词,"188.44.44.11",8080);就这样
      

  4.   


    using (WebClient c = new WebClient())
                {
                    var url = "http://www.ip138.com/ips138.asp?ip=";
                    string s = c.DownloadString(url + ip);
                    return s
                }我一直用这个了...
      

  5.   

    @diaodiaop 你这个是干嘛用的
      

  6.   

    @Hsuifengershi 有分的,问题还没彻底解决,代理IP不稳定又慢。