我正在尝试浏览一些网站。当试图从其中一些中读取时,我得到了一个带有标题的破页,说我被认为是一个机器人。 这是我的代码:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
//req.Timeout = 5000;
req.UserAgent = ProxiesExtension.GetRandomUserAgent();
//request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2";
req.Method = "GET";
//request.ContentType = "application/json";
req.ContentType = "application/x-www-form-urlencoded";
//request.Accept = accept ?? @"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
// request.Headers["Accept-Encoding"] = "gzip, deflate, sdch";
req.Headers.Add("Accept-Language", "en-US,en;q=0.8");
我在这里错过了什么吗?