|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 redaiconglin 于 2022-4-19 16:33 编辑
import requests_html as req
session =req.HTMLSession()
ua = req.UserAgent().random
url ='https://accounts.douban.com/j/mobile/login/basic'
username = '1231' 账号和密码是我随便输入的。真是账号和密码输入后也需要图形验证
password= '321513'
data={'username':username,'password':password}
re = session.post(url,headers={'useragent':ua,'Referer':'https://accounts.douban.com/passport/login_popup?login_source=anony'},data=data)
re.encoding = 'utf-8'
print(re.text)
以上代码模拟登录豆瓣时碰到如下问题请老师帮我看看谢谢了
{"status":"failed","message":"captcha_required","description":"需要图形验证码","payload":{"tc_app_id":"2044348370","captcha_signature_sample":"24:9,11:e","touch_cap_url":"https:\/\/ssl.captcha.qq.com\/TCaptcha.js","captcha_id":"login:captcha:1E6fLVOwgsRTqc4knYWxrpOf","captcha_image_url":"https:\/\/accounts.douban.com\/j\/captcha\/show?vid=login:captcha:1E6fLVOwgsRTqc4knYWxrpOf&size=small"}}
|
|