GithubHelp home page GithubHelp logo

daimai's Introduction

更新

logo

提前准备

  • Python 3.6.3
  • Chromedriver.exe
  • Chrome 浏览器安装好后需将chromedriver.exe放置于Chrome浏览器目录下
  • pip install selenium requests lxml

参数设置

config.json中输入相应配置信息,具体说明如下:

  • date: 日期选择

  • sess: 场次优先级列表

  • price: 票价优先级,如本例**有三档票价,根据下表,则优先选择1,再选择3;也可以仅设置1个。

  • real_name: [1,2], 实名者序号,根据序号共选择两位实名者,根据序号,也可仅选择一位

  • #选择一位或是多位根据购票需知要求:若无需实名制信息则不需要填写;若一个订单仅需提供一位购票人信息则选择一位;若一张门票对应一位购票人信息则选择多位。
    
  • driver_path:浏览器驱动地址

  • nick_name: 用户在大麦网的昵称,用于验证登录是否成功

  • ticket_num: 购买票数

  • damai_url: https://www.damai.cn, 大麦网官网网址

  • target_url: https://detail.damai.cn/item.htm?id=607865020360 目标,例如:周杰伦2023嘉年华世界巡回演唱会--海口站

  • 部分门票需要选择城市,只需选择相应城市后将其网址复制到config.json文件的target_url参数。

  • 根据需要选择的场次和票价分别修改config.json文件中的sessprice参数。

  • 查看购票须知中实名制一栏,若无需实名制则config.json文件中的real_name参数不需要填写(即为[]);若每笔订单只需一个证件号则real_name参数只需选择一个;若每张门票需要一个证件号,则real_name参数根据需购票数量进行相应添加。

  • 若是首次登录,根据终端输出的提示,依次点击登录、扫码登录,代码将自动保存cookie文件(cookie.pkl)

  • 使用前请将待抢票者的姓名、手机、地址设为默认。

  • 配置完成后执行python damai_ticket.py即可,注意观察控制台输出。

  • 本代码为保证抢票顺利,设置循环直到抢票成功才退出循环,若中途需要退出程序请直接终止程序。

热门演唱会信息

daimai's People

Contributors

kemomi 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.