美文网首页大数据 爬虫Python AI SqlPython小哥哥
来迟了,用Python助你叠猫猫,抢618大红包!

来迟了,用Python助你叠猫猫,抢618大红包!

作者: 14e61d025165 | 来源:发表于2019-06-16 15:24 被阅读2次

目录:

0 引言

1 环境

2 需求分析

3 前置准备

4 逛店铺流程回顾

5 代码全景展示

6 总结

0 引言

最近叠猫猫的活动可真是十分的火爆,每天小伙伴们为了合猫猫忙的可谓是如火如荼。为啥要叠猫猫呢?赚猫币得现金红包!!眼看为实,先来看看我朋友的购物订单。

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1560669783249" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

看到没,优惠力度如此之大!!!

后知后觉的我,错过了第一波,可不想错过第二波啊!

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1560669783261" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

活动需要不断的升级自家的猫,其中一个途径是通过逛店铺来获取喵币。每天可逛40店铺,共可领到40*300喵币!!但是,你总不能一直盯着玩吧?想想都累,所以呢,该Python大显身手了。

1 环境

操作系统:Windows

Python版本:3.7.2

手机系统:Android

2 需求分析

我们在手动的操作流程是逛店铺、领喵币,领取成功后,逛下一家店铺。好了,就是这么简单。

这里我们借助的是「adb」工具,配合Python脚本来完成。

3 前置准备

要正常使用「adb」需要打开USB调试,设置项通常出现在手机系统设置中的[开发人员选项]里面。

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1560669783269" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

通过开发者模式中的“指针位置”可以用来获取手机点击时的坐标

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1560669783275" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

4 逛店铺流程回顾

打开淘宝,在右上角找到合猫猫的入口并进入。

第一步,点击"合合卡"

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1560669783279" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

第二步,点击"进店找卡"

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1560669783282" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

第三步,等待10秒左右,点击"猫猫出现啦,点击得喵币"

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1560669783288" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

第四步,点击"开心收下"

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1560669783291" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

第五步,退出此店铺

因为有些店铺的左上角没有退出的按钮,这里为了统一操作,直接使用手机系统的全面屏手势退出即可,我的Honor9手机,是在屏幕左侧向右滑动可回到上一级。

第六步,退出店铺后即回到了主界面,如步骤一。

在这里,我们需要依次记录下"合合卡"、"进店找卡"、"猫猫出现啦,点击得喵币"、"开心收下"的坐标。

5 代码全景展示

<pre spellcheck="false" style="box-sizing: border-box; margin: 5px 0px; padding: 5px 10px; border: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-weight: 400; font-stretch: inherit; font-size: 16px; line-height: inherit; font-family: inherit; vertical-align: baseline; cursor: text; counter-reset: list-1 0 list-2 0 list-3 0 list-4 0 list-5 0 list-6 0 list-7 0 list-8 0 list-9 0; background-color: rgb(240, 240, 240); border-radius: 3px; white-space: pre-wrap; color: rgb(34, 34, 34); letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">import os,time
def pick_maomao():Python学习交流群:1004391443
print(f"点 合合卡 按钮")
os.system('adb shell input tap 145 1625')
time.sleep(1)
print(f"点 进店找卡 按钮")
os.system('adb shell input tap 841 1660')
time.sleep(13)
print(f"猫猫出现啦,点击得喵币")
os.system('adb shell input tap 967 1134')
time.sleep(1)
print(f"点 开心收下")
os.system('adb shell input tap 569 1380')
time.sleep(1)
print(f"利用全面屏手势退出店铺")
os.system('adb shell input swipe 0 1500 500 1500')
time.sleep(1)
for i in range(40):
pick_maomao
</pre>

短短十几行代码,轻松搞定!

将写好了代码放到「adb」工具的同路径下执行即可

<tt-image data-tteditor-tag="tteditorTag" contenteditable="false" class="syl1560669783303" data-render-status="finished" data-syl-blot="image" style="box-sizing: border-box; cursor: text; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: block;"> image

<input class="pgc-img-caption-ipt" placeholder="图片描述(最多50字)" value="" style="box-sizing: border-box; outline: 0px; color: rgb(102, 102, 102); position: absolute; left: 187.5px; transform: translateX(-50%); padding: 6px 7px; max-width: 100%; width: 375px; text-align: center; cursor: text; font-size: 12px; line-height: 1.5; background-color: rgb(255, 255, 255); background-image: none; border: 0px solid rgb(217, 217, 217); border-radius: 4px; transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) 0s;"></tt-image>

最后强调一下,手机连上电脑后,在执行脚本前要确保「adb」命令能正常操控手机。

6 后记

本文代码中的坐标,是在我的Honor9手机上获取到的,因手机型号众多屏幕大小也不同,大家在执行代码前,根据实际情况记录下自己手机上"合合卡"、"进店找卡"、"猫猫出现啦,点击得喵币"、"开心收下"的坐标即可,替换坐标数据后即可正常使用。留给我们的时间不多喽,抓紧时间搞起来吧~~

相关文章

  • 来迟了,用Python助你叠猫猫,抢618大红包!

    目录: 0 引言 1 环境 2 需求分析 3 前置准备 4 逛店铺流程回顾 5 代码全景展示 6 总结 0 引言 ...

  • 来迟了,用Python助你叠猫猫,抢618大红包!

    目录: 0 引言 1 环境 2 需求分析 3 前置准备 4 逛店铺流程回顾 5 代码全景展示 6 总结 0 引言 ...

  • 淘宝618叠猫猫

    宗师场,650w,每天挑战1000级 稳赢局,赶快加入我的战队 吧 【加入我的叠猫猫队伍一起赢喵币,瓜分3亿红I包...

  • 叠猫猫让我玩坏了通讯录

    淘宝618出了一个叠猫猫活动,呐,就是这个活动,促使我给不少微信好友发消息, 帮我叠个猫猫~ 微信好友已经有好多个...

  • 简笔小画萌

    首先我们来叠一摞兔兔: 然后叠一堆猫猫: 兔兔见到方猫猫 哇!他们是谁 热闹了哈哈 开心

  • 叠猫猫

    原来每个女孩都不一样

  • 叠猫猫

    好久没以刷视频的形式娱乐了,果然,还是这种形式最吸引人,刷的不亦乐乎,真快乐。 现在应该调整战略,先把六级放在...

  • 打卡淘宝

    最近天猫618,我每天都按时报道去找猫币叠猫猫,淘宝首页领红包!每次我都能领2-3元,然后还可以翻倍! ...

  • 叠猫猫风波

    微信2014年点开,微信的旅途由此而来。微信也不负众望,随着时代发展,刷微信,扫一扫,小程序,支付,功能一点点的开...

  • 618购物节

    不知道什么时候开始的618大促活动。 我只记得那时候在市区上班,坐公交都在玩叠猫猫,做任务,跟人pk。一旦开始,就...

网友评论

    本文标题:来迟了,用Python助你叠猫猫,抢618大红包!

    本文链接:https://www.haomeiwen.com/subject/grdgfctx.html