Giter VIP home page Giter VIP logo

jdbrandmember's Introduction

GitHub all releasesGitHub release (latest by date)

京东入会领京豆

要求

  1. 有一定的电脑知识 or 有耐心爱折腾
  2. 需要Chrome(推荐)
  3. 操作系统需是 Mac(@zc-nju-med在m1上测试正常)、Linux(在deepin上测试过)、Windows

安装方法

脚本采用Selenium遍历京东入会有礼界面,由于遍历了20000+个店铺,可能所需要的时间比较长(视电脑情况30min-5h)

  1. 克隆到本地

    git clone https://github.com/AntonVanke/JDBrandMember.git
  2. 安装所需要的包

    pip3 install -r requirements.txt
  3. 下载对应的浏览器驱动放到项目的drivers文件夹下面

    1. chrome请访问chrome://version/查看浏览器的版本,然后去ChromeDriver Mirror (taobao.org)下载对应的版本/系统驱动

      /drivers/目录默认的驱动是chromedriver(如下),其它需要替换

      Google Chrome 90.0.4430.212 (正式版本) (x86_64)
      操作系统 macOS 版本11.4(版号20F5055c)

      例如 https://npm.taobao.org/mirrors/chromedriver/90.0.4430.24/,不要下载成了LATEST_RELEASE_*开头的文件了案例

    2. 由于增加了兼容性,所以代码默认不提供Edge(Chromium)Firefox。如果你想要运行在这些浏览器上请修改get_browser函数并在下面的网站获取驱动:

      1. edge请访问edge://version/查看浏览器的版本,Microsoft Edge - Webdriver (windows.net)下载
      2. Firefox请访问Releases · mozilla/geckodriver (github.com)下载

运行

如果你以上步骤执行的没有错误的话,你的文件下会有这些文件:

-JDBrandMember
|
|- drivers
|	|- chromedriver
|
|- main.py
|- shopid.txt
|
|- requirements.txt
|- README.md & LICENSE
首次运行
  1. 运行python3 main.py,如果没有报错的话,会弹出浏览器页面,此时需要你登录京东

  2. 运行之后输入3退出,这时你会看到生成了logs文件夹和config.json

    {
        "thread": 6,  # 运行的线程数
        "binary": "",  # 如果驱动没有找到浏览器的话,需要手动配置路径
        "headless": true,  # 是否开启无头模式?建议打开
        "useUser": 0,  # 使用的用户: 0 表示所有、1 代表第 1 个,以此类推
        "threshold": 0,  # 最小京豆数量,小于此的不会入会
        "is_get_voucher": false,  # 是否获取红包,因为红包的有有效期,所以暂时不用的不要开启
        "users": []  # 用户列表
    }
配置

按照上面的配置你的config.json, 执行python3 main.py,等待执行完毕即可,你可以访问项目下的logs/jdbm.log查看你的日志

注意

不要泄露你的config.json

退出时请使用Ctrl+C输入 3 退出,否则可能本次运行的结果不会保存, 并且可能会遗留大部分线程 Issue #23

较上次更新的内容

  1. 京豆阈值( Issue #23 Issue #13)

  2. 多账号执行(Issue #20)

  3. 突然发现还能领红包??

    红包

LICENSE

MIT License

Copyright (c) 2021 Vanke Anton

jdbrandmember's People

Contributors

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