HTTPWebResponse + StreamReader Very Slow

前端 未结 9 1252
粉色の甜心
粉色の甜心 2020-12-01 01:47

I\'m trying to implement a limited web crawler in C# (for a few hundred sites only) using HttpWebResponse.GetResponse() and Streamreader.ReadToEnd() , also tried using Strea

9条回答
  •  执念已碎
    2020-12-01 02:17

    I had the same problem, but when I sat the HttpWebRequest's Proxy parameter to null, it solved the problem.

    UriBuilder ub = new UriBuilder(url);
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create( ub.Uri );
    request.Proxy = null;
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
    

提交回复
热议问题