发现原来那个爬取验证码的网址用不了,这里更新一个新的爬取验证码的网址

pull/473/head
HandsomeLuoyang 2019-11-30 11:07:06 +08:00
parent 1fa45c26b6
commit c5cf61232e
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ def download_image():
# 抓取验证码
# 存放到指定path下
# 文件名为图像的MD5
url = 'https://kyfw.12306.cn/otn/passcodeNew/getPassCodeNew?module=login&rand=sjrand'
url = 'https://kyfw.12306.cn/passport/captcha/captcha-image?login_site=E&module=login&rand=sjrand'
r = requests.get(url)
fn = hashlib.md5(r.content).hexdigest()
with open(f'{PATH}/{fn}.jpg', 'wb') as fp: