33/crnn

/crnn/ocr.py
# coding: utf-8
# 网页提取验证码
#
# 使用requests+BeautifulSoup来抓取网页
# 使用lxml来解析html
#
# 参考:https://blog.csdn.net/qq_30198555/article/details/53730449

import requests
import re
import urllib.request
import lxml
from bs4 import BeautifulSoup
import time
import random
import os
import json
from PIL import Image
from io import BytesIO
from PIL import ImageFilter
import numpy as np
import cv2

# 代理ip列表
ip = [
'http://122.112.202.11:3128',
'http://219.236.205.18:808',
'http://210.40.67.210:888',
'http://119.28.161.201:808',
'http://163.125.142.176:808',
'http://121.239.107.252:808',
'http://169.234.113.9:808',
'http://61.174.116.245:808',
'http://183.84.151.14:808',
'http://175.126.183.104:808',
'http://112.125.193.132:808',
'http://61.152.200.107:808',
'http://119.195.80.162:808',
'http://218.206.208.138:808',
'http://119.195.69.134:808',
'http://111.74.126.108:808',
'http://202.117.186.198:808',
'http://113.192.127.168:808',
'http://114.97.103.36:808',
'http://117.221.110.227:808',
'http://113.104.129.130:808',
'http://114.93.151.247:808',
'http://117.221.153.117:808',
'http://183.84.160.155:808',
'http://124.237.104.123:808',
'http://123.207.212.59:808',
'http://61.152.201.164:808',
'http://61.152.186.164:808',
'http://113.192.122.221:808',
'http://183.84.160.166:808',
'http://111.200.146.106:808',
'http://117.221.154.117:808',
'http://183.84.162.161:808',
'http://125.233.247.230:808',
'http://124.236.208.134:808',
'http://121.227.101.213:808',
'http://118.110.219.128:808',
'http://123.112.12.94:808',
'http://118.110.220.180:808',
'http://125.233.242.18:808',
'http://113.192.126.246:808',
'http://114.95.247.164:808',
'http://117.221.155.161:808',
'http://113.192.129.134:808',
'http://124.237.104.179: