python - Python 使用请求登录网站返回 403
问题描述
我正在尝试使用. requests
问题是网站返回 403 状态码。
这是我的代码:
import requests
url = 'https://www.zalando-lounge.com/onboarding-api/login'
payload = {
'email': 'my_email',
'password': 'my_password',
'onlyLogin': 'true'
}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0'
}
with requests.Session() as s:
r = s.post(url, json=payload, headers=headers)
print(r.status_code)
print(r.text)
作为回应,我得到 403 状态码,这是:
<HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>
You don't have permission to access "http://failover.www.zalando-lounge.de/waf_deny_lounge.html?" on this server.<P>
Reference #18.379ec817.1608234674.21c18108
</BODY>
</HTML>
解决方案
推荐阅读
- docker - 斯特拉皮 w. Docker-compose - 如何创建配置/服务器以将 Strapi 附加到 url?
- sql - 带有内部连接的物化视图 说
- .net-core - 调试器在 JsonElement.DebuggerDisplay.get 中爆炸
- python - iOS 和 Python 之间的 AES 加密
- sql - Pyspark 聚合使用带有 countDistinct 函数的字典
- redux-saga - 如何将不可序列化的道具从 App 传递给孩子的传奇
- python - 如何使 JSON 对象字段像 SQLAlchemy 模型中的普通数据库列一样?
- python - Python Selenium:我想点击一个按钮。代码运行良好,但尚未单击按钮
- python - 如何使用正则表达式删除列中的单词
- excel - 根据行的类别将行移动到另一个工作表