美文网首页我爱编程
selenium+firefox+python+Pytesser

selenium+firefox+python+Pytesser

作者: yingtaomj | 来源:发表于2017-07-12 15:40 被阅读137次
Firefox和selenium的版本号有一一对应的关系,不是版本低就一定能对上号!

firefox版本:46,下载地址
selenium版本:2.53.0 安装命令:

pip install selenium==2.53.0

验证码OCR工具:

  • PIL 安装命令:pip install Pillow
  • Tesseract 安装教程
  • Pytesser:下载地址(需要翻墙)
    将解压后的整个文件夹放在C:\Python27\Lib\site-packages目录下,将pytesser改成__init__.py,该文件里的import Image改成from PIL import Image,tesseract_exe_name=‘tesseract’所在的目录(不是pytesser自己的目录!)
    在调用Pytesser时,要先用os.chdir("C:\\Python27\\Lib\\site-packages\pytesser")将当前目录改到pytesser所在的目录,再调用pytesser.image_file_to_string(file)函数

相关文章

网友评论

    本文标题:selenium+firefox+python+Pytesser

    本文链接:https://www.haomeiwen.com/subject/awlmhxtx.html