100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > Python爬虫模拟登录(三):手动输入验证码 登录

Python爬虫模拟登录(三):手动输入验证码 登录

时间:2019-05-05 00:08:08

相关推荐

Python爬虫模拟登录(三):手动输入验证码 登录

拿到了参数password,还差一个验证码;

imgurl表示验证码图片地址;

接收图片并显示;

等待输入验证码后提交post;

imgbuf = s.get(imgurl).content# print(len(imgbuf))# f = open('img/yzm.jpg', 'wb')# f.write(imgbuf)# f.close()f = BytesIO()f.write(imgbuf)img = Image.open(f)img.show()vercode = input("Verification Code:")postdata['yzm'] = vercoder = s.post(posturl, postdata)//提交post# print(r.text)

这样就算登录了。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。