Python 如何使用身份验证从sharepoint下载?

Python 如何使用身份验证从sharepoint下载?,python,http,sharepoint,download,upload,Python,Http,Sharepoint,Download,Upload,我一直试图通过python从sharepoint下载.csv文件,但失败了。我在stackoverflow中的答案中找到了以下内容 # Access sharepoint csv = requests.get(url="https://foobar/testbook.xlsx", data={}, auth=(email, pass)) my_df = pandas.read_csv(StringIO(csv.text)) print(my_df) 上述印刷品: Empty DataFrame

我一直试图通过python从sharepoint下载.csv文件,但失败了。我在stackoverflow中的答案中找到了以下内容

# Access sharepoint
csv = requests.get(url="https://foobar/testbook.xlsx", data={}, auth=(email, pass))
my_df = pandas.read_csv(StringIO(csv.text))
print(my_df)
上述印刷品:

Empty DataFrame
Columns: [403 FORBIDDEN]
Index: []
输出中没有错误,所以我想我的身份验证失败了?我正在寻找一种通过身份验证从sharepoint下载/上传文件的方法

感谢您的帮助


谢谢,SharePoint通常使用NTLM身份验证,而请求中的“auth”参数是基本身份验证的缩写

尝试使用ntlm身份验证,如下所述:

首先使用

一旦你收集了客户id和密码

然后使用通过Office365 REST Python客户端下载文件

认证后

client_credentials = ClientCredential('{client_id}','{client_secret}')
ctx = ClientContext('{url}').with_credentials(client_credentials)