使用airtest自动去除点赞

# -*- encoding=utf8 -*-
__author__ = "QinTeng"

from airtest.core.api import *

from poco.drivers.android.uiautomation import AndroidUiautomationPoco
poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)

start_app('com.ss.android.ugc.aweme')
count = 1
#此处是抖音我的按钮
touch(Template(r"tpl1670691968509.png", record_pos=(0.399, 1.031), resolution=(1080, 2400)))
#此处是抖音喜欢的按钮
touch(Template(r"tpl1670692424276.png", record_pos=(0.39, 0.229), resolution=(1080, 2400)))
#poco获取的第一个喜欢列表
poco("android.widget.FrameLayout").offspring("android:id/content").offspring("com.ss.android.ugc.aweme:id/o19").offspring("com.ss.android.ugc.aweme:id/ky=").child("com.ss.android.ugc.aweme:id/q44").child("android.widget.FrameLayout").offspring("com.ss.android.ugc.aweme:id/fkz").child("com.ss.android.ugc.aweme:id/container")[0].click()

w,h=device().get_current_resolution()#获取手机分辨率
#touch([0.5*w, 0.5*h])#点击手机中心位置
#swipe((0.5*w,0.8*h),vector=(0,-0.5),duration=0.1) #在0.1s内上划0.5个屏幕

#我有三千多个视频
while(count<4000):
	#通过相对布局定位点赞按钮
    touch([0.914*w,0.538*h])
    #上下滑动
    swipe((0.8*w,0.8*h),(0.8*w,0.7*h),duration=0.4)
    count=count +1
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值