# -*- 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
使用airtest自动去除点赞
最新推荐文章于 2024-05-30 11:43:13 发布