Code Monkey home page Code Monkey logo

qiangcai's Introduction

QiangCai

上海疫情被封在家,开始抢菜之路,可以开启多台设备同时抢菜

个人微信:sxsuccess,加时请说明来意,否则不通过 微信群:

使用说明: 博客教程地址:https://1024shen.com/archives/7493

远程协助软件地址:https://www.todesk.com/download.html

上海现在抢菜之苦,真的有口说不出,每天早上6点,6点半,8点半,体验过的人的都知道,即便手速再快,还是抢不到..... 然后就有了下面的抢菜程序,完全由Python实现,并会附上教程:(兼容mac和windows平台,抢成功后会播放声音提醒)

一.安装环境 安装python3环境: mac: brew install python windows10以上下载链接: https://wwd.lanzouf.com/i6AEm02zzppi  (安装的时候记得勾选 add python to path) windows7以上下载链接: https://wwd.lanzouf.com/i55kC02zzqsh (安装的时候记得勾选 add python to path)

并安装依赖: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --pre -U uiautomator2

adb:您可以转到[官方文档](https://developer.android.com/studio/command-line/adb) ( mac电脑adb安装:brew install android-platform-tools windows adb安装: 下载链接:https://wwd.lanzouf.com/iQWJT02zyz0h 1.解压 解压到任意目录,例如我都放在D:\Program Files文件夹下面 这样adb的目录就是D:\Program Files\platform-tools 2.添加环境变量 此电脑->系统属性->高级系统设置->环境变量->系统变量->Path->添加->D:\Program Files\platform-tools ) 手机:安卓手机一部或者多部,或者安卓虚拟机一个或者多个

二.调试环境 adb:adb安装成功后,在命令行输入adb,会出现以下提示: adb start-server:启动服务 adb devices:查看连接的设备列表 当安卓手机和电脑连接之后,再输入:adb devices,就可以看到设备编号,记住这个编号,后面有用。 强烈推荐使用安卓虚拟机网易MUMU,官网地址:https://mumu.163.com/mac/index.html (如果用的安卓虚拟机,需要注意:需要先执行:adb kill-server,然后再执行:adb start-server,再执行:adb devices,才会显示设备列表) 设备上安装atx-agent: python -m uiautomator2 init 会在安卓设备上安装一个依赖ATX软件:

三.开始抢菜 打开美团,并进入购物车页面,确认购物车里是有商品的:(没有商品肯定是不行的,对吧) 开始运行代码: python meituan.py

最后看一下成果: (因为我有两个安卓手机,又另外开了一个安卓虚拟机,所以就是下面效果了,哈哈哈哈哈)

再展示一下抢到的菜吧,同时祝大家早日抢到自己喜欢的菜吧,也希望疫情赶紧结束:

qiangcai's People

Contributors

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