【发布时间】:2015-08-30 08:59:17
【问题描述】:
尝试在http://72.ru 站点上进行身份验证,注意到有一个重定向到https://loginka.ru/auth/。发现有 302 POST 与数据形式的普通凭据。从 Chrome 复制标头可以在 cURL 中重现,但仍然无法在请求模块中访问。
警告:页面全是俄文字母,请在东北方的邮箱中注册
with requests.Session() as s:
s.auth = ('EMAIL', 'PASSWD')
s.post('http://72.ru/passport/login.php')
p = s.get('http://72.ru/job/favorite/vacancy/')
# will print True if logged
print('some title from favorite page, if logged' in p.text)
为什么不能认证,我做错了什么?
【问题讨论】:
标签: python authentication redirect curl python-requests