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

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

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

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

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

查看: 6229|回复: 1

[HttpHelper] 关于智联招聘HR端的登录

[复制链接]
发表于 2014-6-21 11:59:03 | 显示全部楼层 |阅读模式
10金钱
我想通过自动登录zhaopin.com的HR端,并自动进行简历的挑选。
很早以前写好了能用,但是有几年没用了,现在好像改版了,需要登录验证码了,而且,登录方式好像也变化了。
以下是我写的代码,通过手工输入验证码的方式实现。但是死活登录不上,已经研究了一两周了,实在搞不清楚了,请大家帮忙看看,哪里出问题了。尤其没搞清楚那个dywe.js的作用。谢谢了!

[C#] 纯文本查看 复制代码
            string url = String.Format("http://www.zhaopin.com/");
            HttpItem item = new HttpItem()
            {
                UserAgent ="Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko",
                Accept ="text/html, application/xhtml+xml, */*",
                URL = url
            };
            http = new HttpHelper();
            //httpresult = http.GetHtml(item);
            //TraceLog.PrintLn(httpresult.Html );
            //Cookies = httpresult.Cookie;


            url = String.Format("http://hr.zhaopin.com/hrclub/index.html");
            item = new HttpItem()
            {
                UserAgent = "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko",
                Accept = "text/html, application/xhtml+xml, */*",
                URL = url
            };
            
            httpresult = http.GetHtml(item);
            //TraceLog.PrintLn(httpresult.Html);
            Cookies = httpresult.Cookie;

            url = "http://rd2.zhaopin.com/s/loginmgr/picturetimestamp.asp?t="+currentTimeMillis();
            item = new HttpItem()
            {
                
                URL = url,                
                ResultType = ResultType.Byte
            };



            httpresult = http.GetHtml(item);
            Cookies = httpresult.Cookie;
            Util aUtil = new Util();
            Image img = aUtil.byteArrayToImage(httpresult.ResultByte);
            img.Save("c:/a.gif" );

            String pictext1 = Console.ReadLine();
            

            //httpresult = http.GetHtml(item);
            //TraceLog.PrintLn(httpresult.Html);



            url = "http://rd2.zhaopin.com/loginmgr/loginproc.asp?DYWE=1402838541843.380746.1402838542.1403269921.2";
            //url = "http://rd2.zhaopin.com/loginmgr/loginproc.asp";

            string postdata2 = String.Format("username={0}&password={1}&Validate={2}&Submit=", username, password, pictext);

            //Cookies = "dywec=95841923; __utmc=269921210; __zpWAMs2=1; JsNewlogin=131012127; RDpUserInfo=; RDsUserInfo=; cgmark=2; isNewUser=1; dywea=95841923.15031524388057552.1402838524.1402838524.1402838524.1; dyweb=95841923.15.10.1402838524; dywez=95841923.1402838524.1.1.dywecsr=(direct)|dyweccn=(direct)|dywecmd=(none)|dywectr=undefined; __utma=269921210.228421887.1402838524.1402838524.1402838524.1; __utmb=269921210.15.10.1402838524; __utmz=269921210.1402838524.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmv=269921210.|2=Member=131012127=1; __zpWAM=1402838541843.380746.1402838542.1402838542.1; __zpWAMs1=1; " + Cookies;
            item = new HttpItem()
            {
                URL =url,
                Method = "POST",
                Accept = "text/html, application/xhtml+xml, */*",
                ContentType = "application/x-www-form-urlencoded",
                Referer = "http://hr.zhaopin.com/hrclub/index.html",
                Cookie =Cookies,                
                Postdata = postdata2,
                Allowautoredirect=true 
            };
            
            httpresult = http.GetHtml(item);
            Cookies = httpresult.Cookie;



1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2014-6-22 18:39:00 | 显示全部楼层
好像并不复杂,不知为什么我传不了附件了。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-24 12:35

© 2014-2021

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