Git Product home page Git Product logo

12306buy's Introduction

用Python抢火车票加邮件通知

本代码文章首发于公众号「Python知识圈」,如需转载,请通过公众号联系作者pk哥,谢谢

公众号

我的个人技术博客

目录

  • 抢票效果

  • splinter 库安装导入

  • 准备工作:初始化属性

  • 登录功能实现

  • 邮件通知实现

  • 查票功能实现

  • 买票功能实现

  • 源码获取方式

抢票效果

运行代码后,Splinter 会自动启动浏览器,代替手工去操作页面,执行打印日志如下。

请输入验证码...
开始购票...
第1次点击查询...
第2次点击查询...
第3次点击查询...
第4次点击查询...
第5次点击查询...
第6次点击查询...
第7次点击查询...
第8次点击查询...

预订失败...
开始预订...
开始选择用户...
提交订单...
确认选座...
预订成功...
抢票通知邮件发送成功!

抢票成功后,我们会收到抢票成功的邮件。 同时,火车票订单中有一张刚才待支付的火车票,手动支付成功后就完成整个抢票流程了。

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.