示例#1
0
 def get_verify(self):
     """
     用在线打码获取验证结果
     :return:
     """
     result = get_result('verify.png')
     print('识别结果:', result)
示例#2
0
    def get_caphe(self):
        xpath_bds = '//*[@id="verifyImg"]'
        # 定位节点 - x y坐标
        location = self.browser.find_element_by_xpath(xpath_bds).location
        # 获取宽度和高度
        size = self.browser.find_element_by_xpath(xpath_bds).size
        # 左上角x y坐标
        left = location['x']
        top = location['y']
        # 右下角x y坐标
        right = left + size['width']
        bottom = top + size['height']
        # 截取验证码图片(crop()):对图片进行剪切
        img = Image.open('index.png').crop((left,top,right,bottom))
        img.save('yzm.png')

        # 在线打码
        result = get_result('yzm.png')
        print(result)
示例#3
0
from ydmapi import get_result

result = get_result('yzm5.jpg')
print(result)
示例#4
0
from ydmapi import get_result
import os

for root, dirs, filenames in os.walk('./Captcha'):
    for filename in filenames:
        result = get_result('./Captcha/' + filename)
        print(result)
示例#5
0
文件: yundama01.py 项目: zlz2013/zlz
 def get_code(self):
     res = get_result('ydm.png')
     return res
示例#6
0
文件: ydm01.py 项目: zlz2013/zlz
from ydmapi import get_result

res = get_result('test.jpg')
print(res)