1、PIL 下载地址: PIL-1.1.7.win-amd64-py2.7.exe

2、tesseract-ocr下载地址: tesseract-ocr-setup-3.02.02.exe

3、pytesseract安装 直接使用pip install pytesseract安装即可,或者使用easy_install pytesseract

下载链接:http://pan.baidu.com/s/1hrVRHYG

#!/usr/bin/env python
# -*- coding: utf-8 -*- ''' try:
import pytesseract
from PIL import Image
except ImportError:
print '模块导入错误,请使用pip安装,pytesseract依赖以下库:'
print 'http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil'
print 'http://code.google.com/p/tesseract-ocr/'
raise SystemExit image = Image.open('vcode.png')
vcode = pytesseract.image_to_string(image)
print vcode
''' import pytesseract
from PIL import Image
import requests def Vercode():
url = "http://www.xxxx"
header = {"user_agent":"Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)"}
r =requests.get(url,headers=header,timeout=5)
with open('vcode.jpg','wb') as pic:
pic.write(r.content)
im = pytesseract.image_to_string(Image.open('vcode.jpg'))
im = im.replace(' ', '')
if im != '':
return im
else:
return Vercode()
print Vcode()

 

参考文章:

  [python]python验证码识别 https://www.waitalone.cn/python-php-ocr.html

  网络信息安全攻防学习平台脚本关过关攻略 https://www.waitalone.cn/security-scripts-game.html

  http://hackinglab.cn/ShowQues.php?type=scripts

pyhton验证码识别的更多相关文章

  1. python3使用pytesseract进行验证码识别

    pytesseract介绍 1.Python-tesseract是一个基于google's Tesseract-OCR的独立封装包: 2.Python-tesseract功能是识别图片文件中文字,并作 ...

  2. 字符型图片验证码识别完整过程及Python实现

    字符型图片验证码识别完整过程及Python实现 1   摘要 验证码是目前互联网上非常常见也是非常重要的一个事物,充当着很多系统的 防火墙 功能,但是随时OCR技术的发展,验证码暴露出来的安全问题也越 ...

  3. 验证码识别<1>

    1. 引子 前两天访问学校自助服务器()缴纳网费,登录时发现这系统的验证码也太过“清晰”了,突然脑袋里就蹦出一个想法:如果能够自动识别验证码,然后采用暴力破解的方式,那么密码不是可以轻易被破解吗? p ...

  4. 简单的验证码识别(opecv)

    opencv版本: 3.0.0 处理验证码: 纯数字验证码 (颜色不同,有噪音,和带有较多的划痕) 测试时间 :  一天+一晚 效果: 比较挫,可能是由于测试的图片是在太小了的缘故. 原理:  验证码 ...

  5. 利用开源程序(ImageMagick+tesseract-ocr)实现图像验证码识别

    --------------------------------------------------低调的分割线-------------------------------------------- ...

  6. 基于LeNet网络的中文验证码识别

    基于LeNet网络的中文验证码识别 由于公司需要进行了中文验证码的图片识别开发,最近一段时间刚忙完上线,好不容易闲下来就继上篇<基于Windows10 x64+visual Studio2013 ...

  7. Java验证码识别解决方案

    建库,去重,切割,识别. package edu.fzu.ir.test; import java.awt.Color; import java.awt.image.BufferedImage; im ...

  8. 简单验证码识别(matlab)

    简单验证码识别(matlab) 验证码识别, matlab 昨天晚上一个朋友给我发了一些验证码的图片,希望能有一个自动识别的程序. 1474529971027.jpg 我看了看这些样本,发现都是很规则 ...

  9. Python验证码识别处理实例(转载)

    版权声明:本文为博主林炳文Evankaka原创文章,转载请注明出处http://blog.csdn.net/evankaka 一.准备工作与代码实例 1.PIL.pytesser.tesseract ...

随机推荐

  1. javascript弹层

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. 安卓程序代写 网上程序代写[转]eclipse快捷键

    F 键类 F2 显示详细信息 F3 跳到声明或定义的地方 Ctrl + 键类 Ctrl+1 快速修复 ( 最经典的快捷键 , 就不用多说了 ) Ctrl+D 删除当前行 Ctrl+E 快速显示当前 E ...

  3. 3、QT分析之消息事件机制

    原文地址:http://blog.163.com/net_worm/blog/static/127702419201001432028526/ 上回我们分析到QPushButton的初始化,知道了Wi ...

  4. 【转】C#多线程环境下调用 HttpWebRequest 并发连接限制

    .net 的 HttpWebRequest 或者 WebClient 在多线程情况下存在并发连接限制,这个限制在桌面操作系统如 windows xp , windows  7 下默认是2,在服务器操作 ...

  5. e606. Determining Which Component or Window Has the Focus

    // null is returned if none of the components in this application has the focus Component compFocusO ...

  6. Python中的base64模块

    本文介绍Python 2.7中的base64模块,该模块提供了基于rfc3548的Base16, 32, 64编解码的接口.官方文档,参考这里. 该模块提供两套接口,传统接口基于rfc1521的Bas ...

  7. python_程序模拟浏览器请求及会话保持

    python下读取一个页面的数据可以通过urllib2轻松实现请求 import urllib2 print urllib2.urlopen('http://www.baidu.com').read( ...

  8. Invalid input for operation: physical_network 'physnet1' unknown for flat provider network.

    在devstack中  按照这个教程给bare metal创建flat network,一切都配置好之后, 执行net-create时遇到错误: Invalid input for operation ...

  9. lakala proportion轨迹分析代码

    /** * Created by lkl on 2017/12/7. */ import breeze.numerics.abs import org.apache.spark.sql.SQLCont ...

  10. Gridview中的选择、删除、编辑、更新、取消留着备用。

    后台程序: public partial class tw2 : System.Web.UI.Page{    protected void Page_Load(object sender, Even ...