前言
提示:以古诗文网为例,获取验证码:
登录:https://so.gushiwen.cn/user/login.aspx
1、不要相信什么验证码的库
首先:真的不要浪费时间,使用什么pytesseract库,什么ddddocr库。这些只能搞搞简单的,复杂点儿的都是搞不定。
比如,这样的,搞不定的:
直接使用打码平台吧,我这里使用的是:云码。
2、以古诗文网为例,获取验证码
1)code_result.py
code_result.py (云码的官方代码)代码如下:
import json
import requests
import base64
class YdmVerify(object):
_custom_url = "http://api.jfbym.com/api/YmServer/customApi"
_token = "" #云码的token
_headers = {
'Content-Type': 'application/json'
}
def common_verify(self, image, verify_type="10110"