Code Monkey home page Code Monkey logo

12306's Introduction

12306

A fast Chinese railway ticket application.

12306 version issues

English | 简体中文

Table of contents

Features

  • 1.Support fast ticket booking
  • 2.Machine automatic identification verification code
  • 3.Multi-person and multi-car purchase tickets
  • 4.Very convenient and stable to use

Environment

System: Windows\Max\Linux
Python: 3.6

Usage

First you need to create a virtual environment for Python3.6

  1. Clone project code
git clone https://github.com/janlle/12306.git 12306
cd 12306
  1. Installation dependence
python install -r requirements.txt
  1. Run application
python start.py
  1. Running log

[root@localhost 12306]# python start.py
Using TensorFlow backend.
Corrupt JPEG data: 17 extraneous bytes before marker 0xd9
2019-12-04 13:44:59,196 INFO      7675  [line: 29]: 题目为: ['樱桃']
2019-12-04 13:45:01,872 INFO      7675  [line: 29]: 选项1.茶几
2019-12-04 13:45:01,872 INFO      7675  [line: 29]: 选项2.电子秤
2019-12-04 13:45:01,872 INFO      7675  [line: 29]: 选项3.蒸笼
2019-12-04 13:45:01,873 INFO      7675  [line: 29]: 选项4.茶几
2019-12-04 13:45:01,873 INFO      7675  [line: 29]: 选项5.蒸笼
2019-12-04 13:45:01,873 INFO      7675  [line: 29]: 选项6.电子秤
2019-12-04 13:45:01,873 INFO      7675  [line: 29]: 选项7.樱桃
2019-12-04 13:45:01,873 INFO      7675  [line: 29]: 选项8.安全帽
2019-12-04 13:45:01,873 INFO      7675  [line: 29]: 答案为: ['7']
2019-12-04 13:45:02,439 INFO      7675  [line: 29]: 验证码校验成功
2019-12-04 13:45:02,805 INFO      7675  [line: 29]: 登录成功,共登录 1 次
2019-12-04 13:45:04,765 INFO      7675  [line: 29]: 验证通过,用户名: 张三
+------+-------------------+-----------------------+-------+--------+--------+--------+----------+------+------+------+------+------+------+
| 车次 | 出发站 - 到达站   | 出发时间 - 到达时间  | 历时  | 商务座 | 一等座 | 二等座 | 高级软卧 | 软卧 | 动卧 | 硬卧 | 软座 | 硬座 | 无座 |
+------+-------------------+-----------------------+-------+--------+--------+--------+----------+------+------+------+------+------+------+
| Z89  | 武昌 - 长沙    | 01:34 - 04:49         | 03:15 | --     | --     | --     | --       | no   | --   | 2    | --   | 8    | 2    |
+------+-------------------+-----------------------+-------+--------+--------+--------+----------+------+------+------+------+------+------+
2019-12-04 13:45:14,249 INFO      7675  [line: 29]: [乘车人: ['张三', '李四'], 出发站: 武昌, 到达站: 长沙, 车次: Z89, 座位: 硬卧, 出发时间: 2019-12-24 01:34:00]
2019-12-04 13:45:14,249 INFO      7675  [line: 29]: 车票订单提交成功,请稍后...
2019-12-04 13:45:14,866 INFO      7675  [line: 29]: 下单成功,请登录 12306 订单中心 -> 火车票订单 -> 未完成订单,支付订单!
[root@localhost 12306]# 

Contributing

This is a open source project. Everyone is welcome to contribute their own code, gradually improve it thanks.

12306's People

Contributors

dependabot[bot] avatar janlle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

12306's Issues

login返回302

I1217 21:38:07.661310 140286887634752 login.py:163] 验证码校验成功
Traceback (most recent call last):
  File "/home/wyh/wyh/2-else/tickets/12306/start.py", line 31, in <module>
    login.login()
  File "/home/wyh/wyh/2-else/tickets/12306/train/login.py", line 57, in login
    login_response = api.post(request_url, data=request_params).json()
  File "/home/wyh/wyh/2-else/tickets/12306/util/net_util.py", line 59, in post
    'Post request failed response status code is %d url: %s' % (response.status_code, url))
BaseException: Post request failed response status code is 302 url: https://kyfw.12306.cn/passport/web/login

求解答

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.