Giter Club home page Giter Club logo

transfer-requests's Introduction

transfer (requests ver.)

因为12306网站改版了,原来用selenium写的不能再用了。并且selenium有个缺点是速度慢,并且考虑到有些人机子上没有装chromedriver,所以现在改用requests重写了一个提供换乘建议的代码。

依赖

这是用python3写的代码。

用到一些包:

requests

用于发送request请求获取车次信息。

json

用于解析12306所用的站名到站代号的映射。

datetime

getopt

使用说明

python transfer.py --from 广州南 --to 端州 --date 2018-12-20 --nearly 12:00 --nlate 22:00

Options

  • --from: 出发站, 目前只支持['广州南', '肇庆', '端州'].
  • --to: 到达站, 目前只支持['广州南', '肇庆', '端州'].
  • --date: 日期, 格式为'yyyy-mm-rr'.
  • --nearly [optional]: 筛选不早于此时间的车次, 格式为'hh:mm'.
  • --nlate [optional]: 筛选不晚于此时间的车次, 格式为'hh:mm'.

Output

  • 接驳方案:A车 -> B车
  • 时间:全程 起始时间-到达时间
  • 总时间
  • 接驳时间:中转接驳时间.

Update

  • 2018/12/20 添加了web版本, 可以通过访问https://coldog.cn/transfer/index.html, 在网页上使用换乘助手. 使得自己不必用PC而只用手机就可以使用这个程序.

TODO

  1. 增加佛山西站作为中转站. (但我还没试过这种操作, 先看看这样方不方便.)
  2. 增加广东省内的其他路线, 可能会用到图算法, 感觉较难, 闲得无聊再吧.
  3. 尝试加入买票功能. (非抢票, 仅自用)

transfer-requests's People

Contributors

coldog2333 avatar

Watchers

 avatar

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.