Python+Selenium自动化之提取图片信息
from PIL import Image
import pytesseract
#上面都是导包,只需要下面这一行就能实现图片文字识别
text = pytesseract.image_to_string(Image.open('E:\example4.jpg',),lang='chi_sim')#设置为中文文字的识别
#text = pytesseract.image_to_string(Image.open('show1.jpg'),lang='eng')设置为英文或阿拉伯数字的识别
print (text)