python实现手机号男女性别判断
如果你觉得有用欢迎关注我吧
本文性别判断主要依靠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=(