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

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

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

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

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

查看: 12659|回复: 17

[HttpHelper] 一个带验证码的网站post老是验证码错误

[复制链接]
发表于 2015-3-24 11:47:27 | 显示全部楼层 |阅读模式
1金钱
我先get验证码然后用打码平台 post+验证码 老说验证码错误 已经换过两个网站了都不行 是不是思路错了呢



1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2015-3-24 11:58:16 | 显示全部楼层
没有忘记带上Cookie吧
回复

使用道具 举报

 楼主| 发表于 2015-3-24 12:03:43 | 显示全部楼层
本帖最后由 329616 于 2015-3-24 12:11 编辑

带了cookie也不行

这是识别验证码的
   public static string dianer()
        {
            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = "http://www.zhoucheng.co/util.php?action=seccode&t=1427168552600",
                Method = "get",//URL     可选项 默认为Get   
                ResultType = ResultType.Byte,
            
            };
            
            HttpResult result = http.GetHtml(item);
            cookie=result.Cookie;
            byte[] bytes = result.ResultByte;
         

   COMFrameLib.COMFrameSoft yydama = new COMFrameSoft(); //新建类接口

           string result1 = yydama.SendAndAceeptByByte("2F88F3Dasdasdasdasdasdsa4A02AA083096C", "ccqyy", "1003", bytes, bytes.Length , 60);
           string[] code = result1.Split('#');
           return code[0];
        } //这是识别验证码的

这是post的
  
            HttpHelper http = new HttpHelper();


            HttpItem  item = new HttpItem()

            {
                URL = "http://www.zhoucheng.co/admin.php?model=login",
                Method="post",
              
                Postdata = "uname=a11111in&pass=8111116&seccode="+dianer()+"",
                Referer = "http://www.zhoucheng.co/admin.php?model=login",
               Cookie=cookie,
               
               
            };
            
            HttpResult result1 = http.GetHtml(item);
            string html = result1.Html;
            Console.WriteLine(html);
         
           
        }这是post的
回复

使用道具 举报

 楼主| 发表于 2015-3-24 12:03:57 | 显示全部楼层
帮我看下是哪里出问题了呢
回复

使用道具 举报

 楼主| 发表于 2015-3-24 12:54:02 | 显示全部楼层
坐等回答
回复

使用道具 举报

 楼主| 发表于 2015-3-24 13:02:17 | 显示全部楼层
我又试了下先get访问登录页面获取cookie 然后用带上cookie获取验证码在用登录页面cookie提交post还是不行
回复

使用道具 举报

发表于 2015-3-24 13:05:48 | 显示全部楼层
用登录页面的Cookie获取验证码,然后再使用这个Cookie登录,

回复要正确使用http://www.sufeinet.com/thread-5175-1-1.html
回复

使用道具 举报

 楼主| 发表于 2015-3-24 14:09:54 | 显示全部楼层
站长苏飞 发表于 2015-3-24 13:05
用登录页面的Cookie获取验证码,然后再使用这个Cookie登录,

回复要正确使用http://www.sufeinet.com/th ...

刚知道怎么回复....
回复

使用道具 举报

 楼主| 发表于 2015-3-24 14:27:19 | 显示全部楼层
站长苏飞 发表于 2015-3-24 13:05
用登录页面的Cookie获取验证码,然后再使用这个Cookie登录,

回复要正确使用http://www.sufeinet.com/th ...

我先获取的登录页面的cookie   这个是登录页面http://www.zhoucheng.co/admin.php?model=login
然后用个这个cookie去获取验证码然后把验证码放到post里 加上登录页面的cookie发出去 还是验证码错误
回复

使用道具 举报

 楼主| 发表于 2015-3-24 14:44:10 | 显示全部楼层
站长苏飞 发表于 2015-3-24 13:05
用登录页面的Cookie获取验证码,然后再使用这个Cookie登录,

回复要正确使用http://www.sufeinet.com/th ...

1.png
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-3-29 21:07

© 2014-2021

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