|
楼主 |
发表于 2014-1-21 17:33:07
|
显示全部楼层
cookie 传不下去,下面我抓了下登陆的包,登陆成功了,但把cookie传下去时显示登陆超时,
奇怪的事,这个登陆的包在服务器上是能登陆成功的
HttpItem item = new HttpItem();
item.Accept = "application/json, text/javascript, */*; q=0.01";
item.Method = "POST";
item.Host = "mp.weixin.qq.com";
item.UserAgent = "Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1";
item.URL = "http://mp.weixin.qq.com/cgi-bin/login?lang=zh_CN";
item.Header["X-Requested-With"] = "X-Requested-With XMLHttpRequest";
item.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
item.Referer = "https://mp.weixin.qq.com/";
item.Postdata = "username=账号&pwd=密码&imgcode=&f=json";
HttpResult result = new HttpHelper().GetHtml(item);
item = new HttpItem();
item.Method = "GET";
item.Host = "mp.weixin.qq.com";
item.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0";
item.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
item.Referer = "https://mp.weixin.qq.com/cgi-bin/home?t=home/index&lang=zh_CN&token=1224738469";
item.Cookie = result.Cookie;
item.CookieCollection = result.CookieCollection;
item.URL = "https://mp.weixin.qq.com/cgi-bin/home?t=home/index&lang=zh_CN&token=1224738469";
string html = new HttpHelper().GetHtml(item).Html; |
|