对于我的一个项目,我需要从一个网站认证的URL获取一个CSV文件。不幸的是,没有API来做这件事。因此,我决定使用请求和会话来获取它。在
登录页面是: http://extranet.ffbb.com/fbi/identification.do
我在页面上查看了HTML代码中的登录名和密码名。登录名是“标识bean.identifiant“密码是”标识bean.mdp". 在
因此,我尝试连接并用以下代码显示返回的HTML,但它返回的HTML代码是错误的登录/密码(就像我从浏览器输入了错误的登录/密码)。我相信我的资历是对的。在
login = "my_login"
password = "my_password"
with requests.Session() as session:
data = {
'identificationBean.identifiant': '{}'.format(config.login),
'identificationBean.mdp': '{}'.format(config.password)
}
url = 'http://extranet.ffbb.com/fbi/identification.do'
response = session.post(url, data=data)
print(response.text)
谢谢你的帮助
目前没有回答
相关问题 更多 >
编程相关推荐