【发布时间】:2020-11-06 00:53:29
【问题描述】:
我正在尝试抓取网络,但作为输出,AADSTS165000: Invalid Request 出现错误。
我的 Python 代码非常简单:
import requests
s = requests.session()
link = 'https://login.microsoftonline.com/.../login'
email = {'loginfmt':'...',
'passwd':'...',}
loging = s.post(link, data = email)
f = open('123.txt', 'w')
f.write(loging.text)
f.close()
但是通过The request did not return all of the form fields. Failure Reasons:[Missing session context cookie;Token was not provided;]获取html输出
如何模拟成功登录并获取 html 的所有要求?
【问题讨论】:
-
This 可能会回答您的问题。它解决了如何使用
requests获取会话 cookie。
标签: python html web web-scraping python-requests