苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

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

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

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

查看: 13309|回复: 10

[其他] 怎么获取美丽说验证码,求帮忙啊飞哥

[复制链接]
发表于 2014-1-19 20:19:15 | 显示全部楼层 |阅读模式
https://account.meilishuo.com/Re ... 0.40405730219724306
session=0.40405730219724306应该怎么获得啊!






1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2014-1-19 23:38:18 | 显示全部楼层
这网站挺奇怪……

meilishuoLogin.rar

69.11 KB, 下载次数: 50, 下载积分: 金钱 -1

发表于 2014-1-19 21:19:57 | 显示全部楼层
这串数字可以随便给,也不会检查,你要也可以随机生成
Math.random().toString()
 楼主| 发表于 2014-1-19 21:34:27 | 显示全部楼层
南方 发表于 2014-1-19 21:19
这串数字可以随便给,也不会检查,你要也可以随机生成
Math.random().toString()

[C#] 纯文本查看 复制代码
            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = "https://account.meilishuo.com/aw/user/logon",//URL     必需项    
                Method = "post",//URL     可选项 默认为Get   
                IsToLower = false,//得到的HTML代码是否转成小写     可选项默认转小写   
                Cookie = "",//字符串Cookie     可选项   
                Referer ="https://account.meilishuo.com/aw/user/logon",//来源URL     可选项   
                Postdata = "login_name=97354625@qq.com&password=520131466&nt=1yQyN1tU7ssTVQ5GeZ16wzLP%2FaJeE%2B4NlnWPvuMw%2FkZ10xG9PEZfXbL%2BExTqPdd8&checkcode=A73g&save_state=1",//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 = "text/html",//返回类型    可选项有默认值   
                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;
        

        /// <summary>
        /// 字节数组生成图片
        /// </summary>
        /// <param name="Bytes">字节数组</param>
        /// <returns>图片</returns>
        private Image byteArrayToImage(byte[] Bytes)
        {
            MemoryStream ms = new MemoryStream(Bytes);
            return Bitmap.FromStream(ms,true);
        }



除开验证码的问题 用以上代码为什么登录不了啊!
发表于 2014-1-19 21:41:25 | 显示全部楼层
没帐号,但是用你的帐号进去是密码错误
 楼主| 发表于 2014-1-19 21:47:50 | 显示全部楼层
南方 发表于 2014-1-19 21:41
没帐号,但是用你的帐号进去是密码错误

5201314666  少了个6
 楼主| 发表于 2014-1-20 11:02:35 | 显示全部楼层
cload 发表于 2014-1-19 23:38
这网站挺奇怪……

谢谢了哦!
发表于 2014-1-20 13:06:50 | 显示全部楼层
关注下~
回复

使用道具 举报

发表于 2014-1-20 15:04:07 | 显示全部楼层
Lese 发表于 2014-1-19 21:34
[C#] 纯文本查看 复制代码
            HttpHelper http = new HttpHelper();
            HttpItem ite ...[/quote]

以下是登录成功的代码:


[mw_shl_code=csharp,true]using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SetHttp;
using csharp中执行js方法;
using System.Text.RegularExpressions;
using System.Net;
namespace 测试
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void txtUser_Enter(object sender, EventArgs e)
        {

                getVecode();

        }

        private string JS(){
            script_run.ScriptEngine myscript = new script_run.ScriptEngine(script_run.ScriptLanguage.JavaScript);
            object result = myscript.Eval("getSession()","function getSession(){return Math.random().toString();}");
            return result.ToString();
        }

        /// <summary>
        /// 获取验证码
        /// </summary>
        private void getVecode() {
            string url = "https://account.meilishuo.com/Register/Captcha?token=asde39ad9&session=" + JS();
            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = url,
                Accept = "image/png, image/svg+xml, image/*;q=0.8, */*;q=0.5",
                Referer = "https://account.meilishuo.com/user/login",
                Cookie = cookie,
                ResultType = ResultType.Byte
            };
            HttpResult result = http.GetHtml(item);
            string statusCodeDescription = result.StatusDescription;
            Image img = Json.byteArrayToImage(result.ResultByte);
            pictureBox1.Image = img;
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            getVecode();
        }
string cookie = string.Empty;
        string nt = string.Empty;

        private void butLogin_Click(object sender, EventArgs e)
        {

           txtLog.Text += "\r\n" + Login(cookie) + "\r\n";
        }

        private string Login(string cookie) {
            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem() { 
                URL = "https://account.meilishuo.com/aw/user/logon",
                Method = "POST",
                Referer = "https://account.meilishuo.com/user/login",
                UserAgent = "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko",
                ContentType = "application/x-www-form-urlencoded; charset=UTF-8",
                Cookie =cookie,               
                Accept = "application/json, text/javascript, */*; q=0.01",
                Postdata = "login_name="+txtUser.Text.Trim().Replace("@","%40")+"&password="+txtPwd.Text.Trim()+"&nt="+nt+"&checkcode="+txtVcode.Text.Trim()+"&save_state=1"            
            };
            //item.Header.Add("nt", nt);
            //item.Header.Add("X-Requested-With", "XMLHttpRequest");
            //item.Header.Add("DNT", "1");

            HttpResult result = http.GetHtml(item);
            return result.Html;

        }
        /// <summary>
        /// 获取nt值
        /// </summary>
        /// <returns></returns>
        public string GetNt(out string cookie) {
            cookie = string.Empty;
            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem() {
                URL = "http://www.meilishuo.com/welcome",
                ResultCookieType = ResultCookieType.CookieCollection
            };
            HttpResult result = http.GetHtml(item);
            cookie = "MEILISHUO_GLOBAL_KEY=" + result.CookieCollection["MEILISHUO_GLOBAL_KEY"].Value;
            cookie += ";santorini_mm=" + result.CookieCollection["santorini_mm"].Value;
            cookie += ";SEASHELL=" + result.CookieCollection["SEASHELL"].Value;
            cookie += ";numInCart=0;LOGON_FROM=http%3A%2F%2Fwww.meilishuo.com%2Fwelcome";
            
            string nt = Regex.Match(result.Html.Replace(" ", ""), @"nt:'([\S]+)?',").Groups[1].Value;

            return nt.Replace("+","%2B").Replace("/","%2F");
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            nt = GetNt(out cookie);
            txtLog.Text += "\r\n" + nt + "\r\n" + cookie + "\r\n";
        }
    }
}
QQ截图20140120150100.jpg
发表于 2014-1-20 15:17:01 | 显示全部楼层
南方直接打包源码上传下~~~
您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

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

GMT+8, 2025-1-4 13:06

© 2014-2021

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