当前位置:网站首页>30行代码实现微信朋友圈自动点赞
30行代码实现微信朋友圈自动点赞
2022-08-09 12:23:00 【xindoo】
首先祝大家新年快乐,过年了,允许我水一篇博客。不知道大家都回老家了没,不过我是没有回去,晚上吃完年夜饭看到很多人发朋友圈,为了增进和大家的友谊,于是就想着给大家点个赞,无奈内容太多了,就搞个自动化脚本,原理和前两天我写的30行代码实现蚂蚁森林自动偷能量一样,这里不再赘述,直接上代码。
import uiautomator2 as u2
import time
# d = u2.connect()
d = u2.connect("192.168.0.102")
# d.app_start("com.tencent.mm")
# time.sleep(0.3)
# d(text="发现").click()
# time.sleep(0.3)
# d(text="朋友圈").click()
def click():
time.sleep(0.2)
d.xpath("//*[@resource-id='com.tencent.mm:id/kn']").click()
time.sleep(0.2)
if d.xpath("//*[@text='赞']").exists:
time.sleep(0.2)
d(text="赞").click()
time.sleep(0.1)
return True
time.sleep(0.3)
return False
def swipeDown():
a = d.xpath("//*[@resource-id='com.tencent.mm:id/kn']")
y = a.get().bounds
dist = y[3]
if dist < 200:
dist = 220
d.swipe(300, dist, 300, 50, 0.2)
time.sleep(0.1)
cnt = 0
while True:
if d.xpath("//*[@text='5小时前']").exists:
break
if click() == False:
cnt = cnt + 1
if cnt > 2:
break
swipeDown()
边栏推荐
- 技术分享 | 接口自动化测试如何处理 Header cookie
- 链表噩梦之一?5000多字带你弄清它的来龙去脉
- WeChat side: what is consistent hashing, usage scenarios, and what problems does it solve?
- Simple understanding of ThreadLocal
- 二叉树的序列化和反序列化
- Flutter入门进阶之旅(四)文本输入Widget TextField
- 【微服务~远程调用】整合RestTemplate、WebClient、Feign
- Flutter Getting Started and Advanced Tour (3) Text Widgets
- Say goodbye to the AI era of hand looms
- LeetCode #101. Symmetric Binary Tree
猜你喜欢
智驾科技完成C1轮融资,此前2轮已融4.5亿元
#物联网征文#小熊派设备开发实战
1-hour live broadcast recruitment order: industry big names share dry goods, and enterprise registration opens丨qubit·viewpoint
史上最猛“员工”,疯狂吐槽亿万富翁老板小扎:那么有钱,还总穿着同样的衣服!...
Intra-group reverse order adjustment of K nodes
罗振宇折戟创业板/ B站回应HR称用户是Loser/ 腾讯罗技年内合推云游戏掌机...今日更多新鲜事在此...
1小时直播招募令:行业大咖干货分享,企业报名开启丨量子位·视点
2022年非一线IT行业就业前景?
Here comes the question: Can I successfully apply for 8G memory on a machine with 4GB physical memory?
Blocking, non-blocking, multiplexing, synchronous, asynchronous, BIO, NIO, AIO all in one pot
随机推荐
在北极都可以穿短袖了,温度飙升至32.5℃
西湖大学教授怎么看AI制药革命?|量子位智库圆桌实录
ABAP 面试题:如何使用 ABAP 编程语言的 System CALL 接口,直接执行 ABAP 服务器所在操作系统的 shell 命令?
ansible-cmdb友好展示ansible收集主机信息
ABAP 报表中如何以二进制方式上传本地文件试读版
Go-based web access parameters
The new features of ABP 6.0.0 - rc. 1
Glory to the Blue Yonder, speeds up the strategic growth
Apexsqlrecover cannot connect to database
大佬们,请教一下,我看官方文档中,sqlserver cdc只支持2012版之后的,对于sqlser
How to save Simulink simulation model as image or PDF
技术分享 | 接口自动化测试如何处理 Header cookie
MySQL 原理与优化,Group By 优化 技巧
苹果Meta都在冲的Pancake技术,中国VR团队YVR竟抢先交出产品答卷
关于Retrofit网络请求URL中含有可变参数的处理
8、IDEA提交代码出现: Fetch failed fatal: Could not read from remote repository
如何修改data work上jdbc驱动的版本
Flutter入门进阶之旅(三)Text Widgets
ansible-cmdb friendly display ansible collects host information
工作任务统计