标题实现自动识别数字二维码并输出验证码
利用selenium截图,找到验证码位置,识别并输出。
(感觉上好像很烦的样子,其实找个储存位置,再找一下验证码位置,其实运行起来很快的。之前在网上找了半天其他的办法,最后还是真香了一下。找了几个大佬的代码,就下面这个最好用。)
代码如下:
# coding = utf-8
import time
import pyautogui as pag
import pytesseract
from PIL import Image, ImageEnhance
from selenium import webdriver
#from selenium.common.exceptions import NoSuchElementException
#from selenium.webdriver.common.action_chains import ActionChains
#from selenium.webdriver.common.by import By
def code():
pag.moveTo(1088,666)
pag.click()
wb.save_screenshot