SharePlumRequestError: SharePlum HTTP Post Failed

SharePlumRequestError: SharePlum HTTP Post Failed

错误截图:

大家好,

我正在尝试建立与 SharePoint 列表的连接,以便我可以 read/write 将数据发送到 SharePoint。下面是我使用 SharePlum 库 运行 形成连接的以下代码。我 运行 与库建议的完全相同的代码与我的凭据和 url 但我收到此错误,我无法在网上找到任何地方。如果您能帮我解决这个问题,我将不胜感激。谢谢

ShareplumRequestError: Shareplum HTTP Post Failed : 403 Client Error: Forbidden for url: https://abc.sharepoint.com/
from shareplum import Site
from shareplum import Office365

sharepointUsername = 'user@abc.com'
sharepointPassword = 'password!'
sharepointSite = 'https://abc.sharepoint.com/sites/MySites/'
website = 'https://abc.sharepoint.com/'

authcookie = Office365(website, username=sharepointUsername, 
             password=sharepointPassword).GetCookies()
site = Site(sharepointSite, authcookie=authcookie)

您似乎正在尝试在线连接到 SP。请指定 版本 参数然后重试。

site = Site('https://xxxxxx.sharepoint.com/sites/sbdev/subtest01',version=Version.v365, authcookie=authcookie)

完整代码: https://github.com/kongmengfei/sharedproject/blob/master/PythonConsole-uploadfileSPO/PythonApplication2/addDocLib.py

上面的demo我已经在我的SPO环境下测试过了,你可以看看

BR