|
2016年,淘宝更新,让我以前的采集店铺产品列表 现在不能采集了!现在代码如下:
string url = "https://shop124210497.taobao.com/search.htm";
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
myRequest.Method = "GET";
myRequest.KeepAlive = false;
myRequest.Timeout = 5000;
myRequest.Proxy = null;
myRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)";
myRequest.Headers.Add("Accept-Language", "zh-CN");
myRequest.Accept = "application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
myRequest.ProtocolVersion = HttpVersion.Version11;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
string code = new System.IO.StreamReader(myResponse.GetResponseStream(), Encoding.GetEncoding("utf-8")).ReadToEnd();
总是提示: 阿里巴巴 - 低版本浏览器升级提醒
|
|