作者:西西里传说
来源:CSDN博客
链接:https://blog.csdn.net/qq_15687823/article/details/103645268
如果你觉得有用欢迎关注我吧
本文性别判断主要依靠airtest中的自动化测试实现
通过自动对比支付宝页面男女图像,从而实现男女判断代码如下:
男女判断函数:
// An highlighted block
def numbe():
if exists(Template(r"tpl1574867500094.png", threshold=0.85, rgb=True, target_pos=0, record_pos=(0.779, 0.382), resolution=(960, 540))):
sex = "女"
if exists(Template(r"tpl1574924960910.png", threshold=0.89, rgb=True, target_pos=5, record_pos=(0.779, 0.382), resolution=(960, 540))):
sex = "男"
else:
sex = "不存在"
namesex = sex
keyevent("4")
return namesex手机滑动(根据手机分辨率自行调整):
// An highlighted block
def scoll():
try:
swipe(v1=(629, 1750),v2=(629