Simple and practical automated login to the Ministry of Railways 12306.cn website

Source: Internet
Author: User
Document directory
  • Analysis of difficulties in website Logon of the Ministry of Railways
  • Technical Analysis
  • Start step
  • Conclusion
Analysis of difficulties in website Logon of the Ministry of Railways
  • Microsoft IE browser is required

    • The Ministry of Railways website only supports Internet payment
  • Websites use HTTPS protocol
    • The client does not allow cross-origin access.
Technical Analysis
  • Use the Microsoft IE developer toolbar to crack the automated Logon Process
Start step
  • To use IE8 and later versions, you need to download the official ie developer Toolbar of Microsoft for IE7 and later versions. The download link is as follows:

    • Internet Explorer developer toolbar: http://www.microsoft.com/download/en/details.aspx? Id = 18359
  • In the IE Address Bar visit the Ministry of Railways login page https://dynamic.12306.cn/otsweb/loginAction.do? Method = init
  • You only need to enter your username, password, and verification code once.
  • Press the F12 shortcut key to bring up the IE developer toolbar> script tab> copy the code to the content text box> click 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.content+doc ument. getelementbyid ('username'); var Password = _ifrmain.contentdomaindoc ument. getelementbyid ('Password'); var randcode = _ifrmain.contentdomaindoc ument. getelementbyid ('randcode'); var sublink = _ifrmain.contentdomaindoc ument. getelementbyid ('sublink'); var submiturl = u RL; $. 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 ('Enter the correct Verification Code ')>-1) {alert (' enter the correct verification code! ') ;}; If (MSG. indexof ('Too many users currently access')>-1) {relogin (MSG);} else {location. replace (queryurl) ;}}, error: function (MSG) {relogin (MSG) ;}, beforesend: function (xhr ){;}});} vaR COUNT = 1; function relogin (MSG) {count ++; sublink. innerhtml = "(" + Count + ") logon... "+ MSG; setTimeout (submitform, 500);} submitform ();
  • Subsequent execution
    • After you click the run script button, the login operation is automated for the customer. You only need to wait until the login is successful.
  • If your user name is displayed, the logon is successful.
Conclusion
  • Insufficient

    • The ticket purchase peak has passed the previous day. This technique is too late. Someone else ordered my ticket. I didn't pay too much attention to using technology to achieve easy login.
  • Foot
    • The return ticket peak is coming soon!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.