分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程
HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成
HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子
谢谢各位的关注,已经解决了。![]() |
站长苏飞 发表于 2015-12-17 13:56 飞哥,关于这个问题,我发更详细的帖子:http://www.sufeinet.com/thread-14933-1-1.html 有时间你帮我看看好吗?非常感谢 |
刚刚发的 图片没有显示在一块,在下面哦 |
Cookie只使用需要的,一般为第一次的,而不需要对接,你抓包看看那里有返回,提前时需要那个Cookie,能清楚,应该还是Cookie问题。搞的这么神秘,直接公开网址看看就是了 |
站长苏飞 发表于 2015-12-17 11:21 HttpHelper httpHelper = new HttpHelper(); HttpItem item = new HttpItem { URL = url, Method = "get", IsToLower = false, Referer = referer, Timeout = this.timeout, ReadWriteTimeout = this.readWriteTimeout, UserAgent = this.userAgent, ContentType = this.contentType, Allowautoredirect = fale, ProxyIp = this.proxy, ResultCookieType = ResultCookieType.CookieCollection, CookieCollection = this.cc_gb, KeepAlive=true, AutoRedirectCookie=true, Cookie= this.cookie_gb, //this.cookie_gb为上一次访问cookie }; //----------问题点--------- /* 1. item.Cookie="重定向url" 2. item.Cookie+="重定向url" 2. item.Cookie="name,value=重定向url" 或者这是item.Cookie应该怎么设置才能重定向到指定的urlA(默认有重定向urlB) 我按群主原来说的方法就是先操作: 当然Allowautoredirect = fale, HttpResult htmlResult = httpHelper.GetHtml(item); 然后用 htmlResult.RedirectUrl去get,如下: item.Cookie+= oldCookie; //用上次cookie HttpResult html = httpHelper.GetHtml(htmlResult.RedirectUrl); 这样结果还是不行 */ //-------请求---------- HttpResult html = httpHelper.GetHtml(item); |
justinpanrobot 发表于 2015-12-17 10:26 手动设置啊,每一次都有cookie带入我输出的, |
这似乎是要修改cookie? 我抓包发现在不设置coolie情况下重定向到a1,修改cookie后重定向到设置的url,但这时候cookie应该怎么设置呢?在线等待,万分感谢! |
站长苏飞 发表于 2015-12-17 09:29 楼主 ,大体意思是这样的: 我get一个网址a,然后a自动重定向到一个网站a1,现在我想同样访问网址a但修改这个重定向到a2,那应该怎么做呢? |