【发布时间】:2021-07-20 22:23:06
【问题描述】:
谁能帮我获取此网页中的访问令牌?我正在尝试进行网络抓取,但无法自动获取令牌。 http://200.75.4.210:8080/CIODCH/login.aspx
这是我目前所拥有的,但我无法在响应中获取令牌...
# Get the token
headers = {
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'}
login = {
'Password': "123456789.", #it is a generic password, please dont change it
'Usuario': "XXXXXXX"}
response = requests.post('https://apidch.kairosmining.com/auth/login', headers=headers, data=login).json()
# Use the token to input into the headers
url = 'http://apidch.kairosmining.com/api/CalidadAFlotacion'
headers.update({'authorization': 'Bearer %s' % response['token']})
这是我将在其中进行网络抓取的 url http://200.75.4.210:8080/CIODCH/Intra/calidadproducto/cpfvista.aspx
【问题讨论】:
-
您提供的用户名/密码似乎无效,我无法使用浏览器登录
-
请再试一次...我刚改了
标签: python web-scraping beautifulsoup