python 识别验证码

来源:互联网 发布:年轻员工管理知乎 编辑:程序博客网 时间:2024/05/16 16:12

需要用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 Imageim = Image.open("http://www.baoyide.com.cn/Member/common/verify?t=0.3812277084340663")

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


0 0