拿到了参数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)
这样就算登录了。