python朋友圈自动点赞_基于airtest的朋友圈自动点赞

本脚本可以通过AirtestIDE和python执行,推荐使用AirtestIDE的环境执行,更稳定一些

AirtestIDE官方文档

使用python执行该脚本

安装库 airtest、pocoui

pip install airtest

pip install pocoui

代码如下

# -*- encoding=utf8 -*-

__author__ = "admin"

from airtest.core.api import *

from poco.drivers.android.uiautomation import AndroidUiautomationPoco

poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)

connect_device("Android://127.0.0.1:5037/f350e2f7")

print("start...")

PKG = "com.tencent.mm" # 微信包名

stop_app(PKG) # 关闭此app

wake() # 唤醒并解锁设备

home() # 返回HOME界面

start_app(PKG) # 启动此app

poco(text='发现').wait(2).click()

pyq = poco(text='朋友圈')

pyq.click()

while True:

try:

# 评论按钮

comments = poco("com.tencent.mm:id/eho")

for comment in comments:

childX, childY = comment.get_position()

print(childX)

print(childY)

if (childY >= 0.1 and childY < 1.0):

comment.click()

zan = poco(text='赞')

if zan.exists():

zan.click()

except Exception as e:

print('error'+str(e))

keyevent("BACK") # 有可能进入其它页面,调用系统级返回按钮

if pyq.exists(): # 如果返回到发现页,重新进入朋友圈

pyq.click()

swipe((500, 1700), (500, 900)) # 向上滑动

来源于https://blog.csdn.net/qq_38534107/article/details/93232179

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值