一:tesseract的使用
1.定义:
Tesseract是一个将图像翻译成文字的OCR库(光学文字识别,Optical Character Recognition)
2.安装:
sudo apt-get install tesseract-ocr
3.在python中调用Tesseract
pip install pytesseract
4.Tesseract处理规范的文字
在终端中:
tesseract test.jpg text
在python代码中:
import pytesseract
from PIL import Image
image=Image.open(jpg)
pytesseract.image_to_string(image)
二:driver的安装
phantomjs安装指南
#官网安装,apt_get可能会报错
--解压文件
tar -xvr phantomjs-1.9.7-linux-x86_64.tar.bz2
-将程序移到一个合适的位置