python 识别验证码

需要用scrapy 采集,自动识别验证码,安装PIL 报错

pip install PIL

Collecting PIL Could not find a version that satisfies the requirement PIL (from versions: )No matching distribution found for PIL

PIL  没有合适的版本。  现在安装  pillow

执行命令   pip install  pillow

出现以下错误

ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

安装   问题缺少模块,接着安装  jpeg   需要 libjpeg-dev libpng-dev等依赖库,执行以下命令用 yum 安装 来安装

yum install libjpeg-devel freetype-devel

然后安装成功了 使用的时候这样就行了

from PIL import Image
im = Image.open("http://www.baoyide.com.cn/Member/common/verify?t=0.3812277084340663")

点击查看我的采集案例    可以加我qq 602663099 探讨 scrapy采集问题


猜你喜欢

转载自blog.csdn.net/HunShiAPeng/article/details/51469770