Shareplum Office 365连接自动中断

2024-04-20 03:40:36 发布

您现在位置:Python中文网/ 问答频道 /正文

在过去一个月左右的时间里,我每天都在使用以下代码来提取SP列表并连接到另一个数据源

from shareplum import Site

from shareplum import Office365

import pandas as pd

authcookie = Office365('https://COMPANY.sharepoint.com', username='SharePointAdmin@COMPANY.com', password='ADMINPW').GetCookies()

. . .

然而,它似乎已经自发地中断,我现在得到了错误:

Exception: Check username/password and rootsite

我没有足够的Python或sharepoint知识来理解这个错误到底是谁造成的。这似乎是一个身份验证问题,但工作正常,我们的SP人员说没有任何变化


Tags: 代码fromimportcom列表错误时间username
1条回答
网友
1楼 · 发布于 2024-04-20 03:40:36

连接到Office 365时,请添加以下参数:

authcookie = Office365(base_path, username=username, password=password).GetCookies()
site = Site('https://my.sharepoint.com/sites/sbdev',version=Version.v365, authcookie=authcookie)

这是一个演示,您可以参考: downloadfile.py

相关问题 更多 >