短视频app源码,图形和短信验证码的自动识别获取
图形验证码识别
driver.save_screenshot('v_code.png') # 先把整个页面截图下来
element = driver.find_element_by_id('sccImg') # 定位验证码元素
print("验证码元素位置:", element.location)
print("验证码元素尺寸:", element.size)
left = element.location['x']
top = element.location['y']
right = element.location['x'] + element.size['width']
bottom = element.location['y'] + element.size['height']
im = PIL.Image.open('v_code.png')
im = im.crop((left, top, right, bottom))
# im.show()
image=pytesseract.image_to_string(im)
短信验证码自动获取
url = "查看api文档"
response = requests.get(url)
print(response.text)
以上就是短视频app源码,图形和短信验证码的自动识别获取, 更多内容欢迎关注之后的文章
标签:自动识别,app,验证码,element,源码,im,location From: https://www.cnblogs.com/yunbaomengnan/p/17838643.html