Code Monkey home page Code Monkey logo

buy-xiaomi's Introduction

buy-xiaomi

抢小米手机脚本,基于 puppeteer.js 仅辅助更快操作浏览器

Use

// 安装依赖
yarn install

// 启动脚本
node buy.js

更好的抢购规则

// 越前面的越优先购买,前面的没货才购买后面
const buyRule = [
  {
    // 8GB+128GB + 幻境
    GB: { type: 1, index: 1 },  // 选择版本为第一栏 type = 1, index = 1 选择版本中的第 1 个型号 
    color: { type: 2, index: 3 } // 选择颜色为第二栏 type = 2, index = 3 选择版本中的第 3 个颜色
  },
  {
    // 8GB+128GB + 晴雪
    GB: { type: 1, index: 1 },
    color: { type: 2, index: 2 }
  },
  {
    // 8GB+256GB + 幻境
    GB: { type: 1, index: 3 },
    color: { type: 2, index: 3 }
  },
  {
    // 8GB+256GB + 晴雪
    GB: { type: 1, index: 3 },
    color: { type: 2, index: 2 }
  }
];

浏览器获取选择器

// 选择器通过浏览器 elements -> 右键 -> Copy -> Copy selector 复制
例如:'#app > div.mi-detail > div > div > div > div.product-box.container > div.product-con > div.btn-box > div.sale-btn > a'

效果预览:

效果预览

声明

本脚本仅供米粉购买小米系列产品,请勿当黄牛!

buy-xiaomi's People

Contributors

shunyue1320 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

buy-xiaomi's Issues

修改url抢购米11没有效果

是不是抢购时间设置时间的问题,但是我修改了抢购时间为下一分钟也没看到效果,页面只会停留在米11抢购页面,也没有加入购物车。是不是还需要修改其他的地方呢?

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.