你好,我正在制作一个程序,需要从sharepoint下载文件,但我无法获得sharepoint文档的内容。我使用sharepy模块遵循了这个tuto,它可以很好地进行身份验证,但不能获得文档的内容。你知道吗
这是我的sharepoint(带有几个测试文件):
我尝试了不同的方法来满足Microsoft documentation
以下是从sharepoint文档获取内容的代码:
def contentSharepoint():
# (1) Authenticate
s = sharepy.connect("kinesiprevention.sharepoint.com", username='******', password='******')
# (2) Get file information
r = s.get("https://kinesiprevention.sharepoint.com/_api/web/GetFolderByServerRelativeUrl('/Shared Documents')/Files")
print('r is :'+str(r))
data = r.json()
print('data :' + str(data))
file = open("sharepoint.json", "w")
file.write(json.dumps(data, indent=4))
print("json file has been generated")
我有一个回应,但没有内容:
目前没有回答
相关问题 更多 >
编程相关推荐