Project address: http://code.google.com/p/go-home/, source code svnaddress: http://go-home.googlecode.com/svn/trunk/
The old ticket booking software last year may have expired, but I just learned the basic ticket booking process to facilitate the study of other ticket booking scripts.
Basic flowchart:
1. Obtain the image Verification Code
Submit request to https://dynamic.12306.cn/otsweb/passCodeAction.do? Rand = sjrand,
2. Obtain the random number used for login,
Submit request to https://dynamic.12306.cn/otsweb/loginAction.do? Method = loginaysnsuggest,
3. log on and submit the request to the supervisor.
COOKIE: JSESSIONID = 6009b4610f436d8023126256fb598bdd; bigipserverotsweb = 2413035786.48160.0000
4. query the qualified vehicle count information,
Submit request to https://dynamic.12306.cn/otsweb/order/querySingleAction.do,
5. Judge the queried vehicle count information, find the appropriate vehicle count, and check whether there is a proper seat,
6. reserve a ticket and submit your request
Https://dynamic.12306.cn/otsweb/order/querySingleAction.do? Method = submutorderrequest,
7. Get the token and submit the request
Https://dynamic.12306.cn/otsweb/order/querySingleAction.do? Method = init
8. Get the token, submit the order, and submit the request
Https://dynamic.12306.cn/otsweb/order/confirmPassengerAction.do? Method = confirmpassengerinfosingle
9. query the order status. Submit a request
Https://dynamic.12306.cn/otsweb/order/myOrderAction.do? Method = querymyordernotcomplete