http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 6339|回复: 4

[HttpHelper] 得不到这个网站的第二页源码

[复制链接]
发表于 2015-5-20 16:43:05 | 显示全部楼层 |阅读模式
15金钱
得不到这个网站的第二页源码,网址:http://www.qqhrhb.gov.cn/branch.aspx?id=10401,请给出程序源码,谢谢帮忙

最佳答案

查看完整内容

这个好办,还是用2楼站长的代码,把postdata里面的viewstate换成我这个 [mw_shl_code=csharp,true]__VIEWSTATE=%2FwEPDwUKMTI2NzIyNjQ4Mw8WAh4IdGhpc3BhZ2UCBRYCAgEPZBYIAgIPDxYCHgRUZXh0BVYgPGEgaHJlZj1DYXRlZ29yeS5hc3B4P2lkPTEwNCBjbGFzcz10aXQxMz7njq%2For4Tpobnnm648L2E%2BIC0%2BIOWuoeaJuemhueebruWPl%2BeQhuaDheWGtWRkAgMPDxYCHwEFGOWuoeaJuemhueebruWPl%2BeQhuaDheWGtWRkAgQPPCsADQEADxYGHgtfIURhdGFCb3VuZGceCVBhZ2VDb3V ...


1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2015-5-20 16:43:06 | 显示全部楼层
这个好办,还是用2楼站长的代码,把postdata里面的viewstate换成我这个
[C#] 纯文本查看 复制代码
__VIEWSTATE=%2FwEPDwUKMTI2NzIyNjQ4Mw8WAh4IdGhpc3BhZ2UCBRYCAgEPZBYIAgIPDxYCHgRUZXh0BVYgPGEgaHJlZj1DYXR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4Tku7fmlofku7blj5fnkIbmg4XlhrXnmoTlhaznpLpkAgEPDxYCHwEFCjIwMTQtMDItMTBkZAIQD2QWBGYPZBYCZg8VAiAxQ0I0MzI3MTA5MzNGRUMwREM1QTcxN0EwRUE1RDNDQU%2FlhbPkuo4yMDE05bm0MeaciDEw5pel5bu66K6%2B6aG555uu546v5aKD5b2x5ZON6K%2BE5Lu35paH5Lu25Y%2BX55CG5oOF5Ya155qE5YWs56S6ZAIBDw8WAh8BBQoyMDE0LTAxLTEwZGQCEQ9kFgRmD2QWAmYPFQIgMUNCNDMyNzEwOTMzRkVDMEQ0MEU4MkREMEY1RjE0RjFO5YWz5LqOMjAxNOW5tDHmnIg45pel5bu66K6%2B6aG555uu546v5aKD5b2x5ZON6K%2BE5Lu35paH5Lu25Y%2BX55CG5oOF5Ya155qE5YWs56S6ZAIBDw8WAh8BBQoyMDE0LTAxLTA4ZGQCEg9kFgRmD2QWAmYPFQIgMUNCNDMyNzEwOTMzRkVDMEZBMTMyRjQ3RjlBRDhCQkNO5YWz5LqOMjAxNOW5tDHmnIgz5pel5bu66K6%2B6aG555uu546v5aKD5b2x5ZON6K%2BE5Lu35paH5Lu25Y%2BX55CG5oOF5Ya155qE5YWs56S6ZAIBDw8WAh8BBQoyMDE0LTAxLTAzZGQCEw8PFgIfBWhkZAIGDw8WAh8FZ2RkGAEFCk15R3JpZFZpZXcPZ2QBn8miCi20k2xfwDUQrhE8IARayw%3D%3D&DetailsText=&gotopagebox=3&gotopage=%D7%AA%B5%BD

注意结尾部分的 gotopagebox=3  ,这个数字就是页码啦。已用苏飞开发助手测试ok
回复

使用道具 举报

发表于 2015-5-20 16:51:54 | 显示全部楼层
[C#] 纯文本查看 复制代码
            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = "http://www.qqhrhb.gov.cn/branch.aspx?id=10401",//URL     必需项    
                Method = "post",//URL     可选项 默认为Get   
                IsToLower = false,//得到的HTML代码是否转成小写     可选项默认转小写   
                Cookie = "ASP.NET_SessionId=ur5xjrigk3ashrmlbgj52p55",//字符串Cookie     可选项   
                Referer ="http://www.qqhrhb.gov.cn/branch.aspx?id=10401",//来源URL     可选项   
                Postdata = "__VIEWSTATE=%2FwEPDwUKMTI2NzIyNjQ4Mw8WAh4IdGhpc3BhZ2UCARYCAgEPZBYIAgIPDxYCHgRUZXh0BVYgPGEgaHJlZj1DYXRlZ29yeS5hc3B4P2lkPTEwNCBjbGFzcz10aXQxMz7njq%2For4Tpobnnm648L2E%2BIC0%2BIOWuoeaJuemhueebruWPl%2BeQhuaDheWGtWRkAgMPDxYCHwEFGOWuoeaJuemhueebruWPl%2BeQhuaDheWGtWRkAgQPPCsADQEADxYGHgtfIURhdGFCb3VuZGceCVBhZ2VDb3VudAIBHgtfIUl0ZW1Db3VudAISZBYCZg9kFihmDw8WAh4HVmlzaWJsZWhkZAIBD2QWBGYPZBYCZg8VAiA2RDEyNkRFQTczNjg2QzgxRTkwOUZCQUIzQjYyMEY1ME%2FlhbPkuo4yMDE15bm0NeaciDIw5pel5bu66K6%2B6aG555uu546v5aKD5b2x5ZON6K%2BE5Lu35paH5Lu25Y%2BX55CG5oOF5Ya155qE5YWs56S6ZAIBDw8WAh8BBQoyMDE1LTA1LTIwZGQCAg9kFgRmD2QWAmYPFQIgNkQxMjZERUE3MzY4NkM4MTVBRkE4NjlCMTUwQkQwN0VP5YWz5LqOMjAxNeW5tDXmnIgxOOaXpeW7uuiuvumhueebrueOr%2BWig%2BW9seWTjeivhOS7t%2BaWh%2BS7tuWPl%2BeQhuaDheWGteeahOWFrOekumQCAQ8PFgIfAQUKMjAxNS0wNS0xOGRkAgMPZBYEZg9kFgJmDxUCIDI1OTNFNzZEQzY5NjYxODRBREEwMzYzNkM4QjlFMTQ4T%2BWFs%2BS6jjIwMTXlubQ05pyIMTPml6Xlu7rorr7pobnnm67njq%2FlooPlvbHlk43or4Tku7fmlofku7blj5fnkIbmg4XlhrXnmoTlhaznpLpkAgEPDxYCHwEFCjI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Text=&nextpage=%CF%C2%D2%BB%D2%B3&gotopagebox",//Post数据     可选项GET时不需要写   
                Timeout = 100000,//连接超时时间     可选项默认为100000    
                ReadWriteTimeout = 30000,//写入Post数据超时时间     可选项默认为30000   
                UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",//用户的浏览器类型,版本,操作系统     可选项有默认值   
                ContentType = "application/x-www-form-urlencoded",//返回类型    可选项有默认值   
                Allowautoredirect = false,//是否根据301跳转     可选项   
                //CerPath = "d:\123.cer",//证书绝对路径     可选项不需要证书时可以不写这个参数   
                //Connectionlimit = 1024,//最大连接数     可选项 默认为1024    
                ProxyIp = "",//代理服务器ID     可选项 不需要代理 时可以不设置这三个参数    
                //ProxyPwd = "123456",//代理服务器密码     可选项    
                //ProxyUserName = "administrator",//代理服务器账户名     可选项   
                ResultType = ResultType.String
            };
            HttpResult result = http.GetHtml(item);
            string html = result.Html;
            string cookie = result.Cookie;
        



算法自己想办法解决吧
回复

使用道具 举报

 楼主| 发表于 2015-5-20 17:25:39 | 显示全部楼层
请问那个Postdata的__VIEWSTATE参数是写固定,还是从其他地方得到的呢,我试着先用get方法得到过页面的的__VIEWSTATE,然后再post ,但不成功,写固定可以,但只能得到第二页的源代码
回复

使用道具 举报

 楼主| 发表于 2015-5-21 13:58:06 | 显示全部楼层
你这个__VIEWSTATE在哪里得到的??
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-11-24 05:34

© 2014-2021

快速回复 返回顶部 返回列表