在IE里访问正常。。这个是什么原因呢?我设置了采集一条后暂停几秒钟
[C#] 纯文本查看 复制代码 HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "http://weixin.sogou.com",//URL这里都是测试 必需项
Encoding = null,//编码格式(utf-8,gb2312,gbk) 可选项 默认类会自动识别
//Encoding = Encoding.Default,
Method = "get",//URL 可选项 默认为Get
};
//得到HTML代码
HttpResult result = http.GetHtml(item);
item = new HttpItem()
{
URL = "http://weixin.sogou.com/weixin?type=1&query=caipiaobao_cp365&ie=utf8&_sug_=y&_sug_type_=",//URL这里都是测试URl 必需项
Encoding = null,//编码格式(utf-8,gb2312,gbk) 可选项 默认类会自动识别
//Encoding = Encoding.Default,
Allowautoredirect=true,
UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0",
Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
Method = "get",//URL 可选项 默认为Get
Cookie = result.Cookie,
};
//得到新的HTML代码
result = http.GetHtml(item);
|