一、验证码识别
1.反爬机制:验证码、识别验证码图片中的数据,用于模拟登陆操作
2.识别验证码的操作:
1)人工肉眼识别(不推荐)
2)第三方自动识别(推荐)
- 超级鹰
二、实战:识别超级鹰登陆页面中的验证码
-超级鹰所提供的的代码
-在个人库中将其定义为yh
#!/usr/bin/env python
coding:utf-8
import requests
from hashlib import md5
class Chaojiying_Client(object):
def __init__(self, username, password, soft_id):
self.username = username
password = password.encode('utf8')
self.password = md5(password).hexdigest()
self.soft_id = soft_id
self.base_params = {
'user': self.username,
'pass2': self