2012网络订火车票必胜秘籍(登陆成功率极高)

2012网络订火车票必胜秘籍(登陆成功率极高)

晓染霜林醉 QQ:51817

博客:http://www.cnblogs.com/DivClose/

今年新增加了网络订火车票的途径,一下子使铁路客户服务中心网站的访问量激增至全球第9!该网站访问速度之慢也让民众的口水随即而来,订票比批评铁道部重要,开始我们的百战百胜网络订票之路。

一、准备工作

1、访问http://www.95105105.com/网站,查询你的出发站(乘车站)的网络订票时间。比如我要订“黄石—>郑州”的火车票,就查武汉铁路局的售票时间。

 

查看指南,查到

 

这就需要在可以订票的那天10:00前登陆到铁路客户服务中心网站上。我的个人经验是至少提前半个小时开始用如下自动登陆的方法登陆网站

2、使用IE8及其以上的版本,IE7及以下版本需要另外下载微软官方的IE开发者工具栏,下载链接如下:

Internet Explorer Developer Toolbar:  http://www.microsoft.com/download/en/details.aspx?id=18359

3、准备好网银,确保能网上支付,预定成功了45分钟之内需要支付费用,否则订单会被取消。

4、提前登记订票用户信息。登陆成功后,点击铁路客户服务中心网站左上角的 ,在左侧的菜单栏中,选择常用联系人。把需要买票和你帮忙订票的人的信息都登记上。在下订单的时候,你就可以直接选择已经有的联系人,可以省很多时间,你懂的。

 

二、操作步骤

1、 在IE地址栏中访问铁道部登录页面 https://dynamic.12306.cn/otsweb/loginAction.do?method=init

2、 需要 且 只需要输入一次自己的用户名,密码,验证码即可 

 

3、 按F12快捷键调出IE开发者工具栏 >>> Script(脚本)选项卡 >>> 复制如下图代码到内容文本框中 >>>  点击 Run Script(运行脚本) 按钮

var page = "https://dynamic.12306.cn/otsweb/loginAction.do?method=init";

var url = "https://dynamic.12306.cn/otsweb/loginAction.do?method=login";

var queryurl = "https://dynamic.12306.cn/otsweb/order/querySingleAction.do?method=init";

 

function submitForm() {

    var _ifrMain = document.getElementById('main');

    var userName = _ifrMain.contentWindow.document.getElementById('UserName');

    var password = _ifrMain.contentWindow.document.getElementById('password');

    var randCode = _ifrMain.contentWindow.document.getElementById('randCode');

 

    var submitUrl = url;

    $.ajax({

        type: "POST",

        url: submitUrl,

        data: {

            "loginUser.user_name": userName.value

          , "user.password": password.value

          , "randCode": randCode.value

        },

        timeout: 30000,

        success: function (msg) {

            if (msg.indexOf('请输入正确的验证码') > -1) {

                alert('请输入正确的验证码!');

            };

            if (msg.indexOf('当前访问用户过多') > -1) {

                reLogin('回调结果:当前访问用户过多');

            }

            else {

                location.replace(queryurl);

            };

        },

        error: function (msg) {

            reLogin('回调结果:错误');

        },

        beforeSend: function (XHR) {

           ;

        }

    });

}

 

var count = 1;

function reLogin(msg) {

    count++;

    skm_LockScreen("(" + count + ")次登录中..." + msg);

    setTimeout(submitForm, 500);

}

 

function skm_LockScreen(str) {

    scroll(0, 0);

    var back = document.getElementById('skm_LockBackground');

    var pane = document.getElementById('skm_LockPane');

    var text = document.getElementById('skm_LockPaneText');

 

    var LockBackgroundCssString = "position: absolute;top: 0px;left: 0px;visibility: visible;display: block;width: 105%;height: 105%;background-color: #666;z-index: 999;filter: alpha(opacity=75);opacity:0.75;padding-top: 20%;";

 

    var LockPaneCssString = "z-index: 1000;position: absolute;top: 0px;left: 0px;padding-top: 25%;visibility: visible;display: block;text-align: center;width: 100%;";

 

    var textCssString = "width: 55%;background-color: #969;color: White;font-size: large;border: dotted 1px White;padding: 9px;margin-left: auto;margin-right: auto;";

      

    if (back)

        back.style.cssText = LockBackgroundCssString; 

    if (pane)

        pane.style.cssText = LockPaneCssString; 

    if (text) {

        text.innerHTML = str;

        text.style.cssText = textCssString; 

    }

}

 

var loginoutElement = document.getElementById('login_out');

loginoutElement.innerHTML = "<div id='skm_LockBackground' style='display: none;visibility: hidden;position: absolute;top: -100px;left: -100px;'></div><div id='skm_LockPane' style='display: none;visibility: hidden;position: absolute;top: -100px;left: -100px;'><div id='skm_LockPaneText'> </div></div>"; 

 

submitForm();

 

4、 后面执行情况说明

点击了运行脚本按钮后,就开始默默等待吧。繁忙的时候可能需要5-6分钟才能登陆上去,一般3分钟能登陆上。登录操作是自动化的了,无需其他操作,。

5、 登陆成功后会看到自己的用户名后,如下图。

 

6、下面就是查询、订票、支付了。占着坑就好说了。

 

三、感谢

感谢shss提供的自动登陆代码,他的博客地址是:http://www.cnblogs.com/cnshangsha/

祝大家订票成功。

posted @ 2012-01-16 16:20  晓染霜林醉  阅读(474)  评论(0编辑  收藏  举报