我正在尝试使用分享梅花 https://pypi.python.org/pypi/SharePlum/0.1.1这是 SharePoint 的 Python 模块,但是当我尝试连接到我的 SharePoint 时,SharePlum 会向我抛出以下错误:
回溯(最近一次调用最后一次):
文件“C:/Users/me/Desktop/Sharpoint/sharpoint.py”,第 13 行,位于 site = Site(sharepoint_url, auth=auth)
文件“C:\Users\me\AppData\Local\Programs\Python\Python36\lib\site-packages\shareplum\shareplum.py”,第 46 行,位于initself.users = self.GetUsers()
文件“C:\Users\me\AppData\Local\Programs\Python\Python36\lib\site-packages\shareplum\shareplum.py”,第 207 行,在 GetUsers 中引发异常(“无法获取用户信息列表”)
异常:无法获取用户信息列表
这是我编写的非常短的代码:
auth = HttpNtlmAuth(username, password)
site = Site(sharepoint_url, auth=auth)
这个错误似乎表明用户名/密码错误,但我很确定我的用户名/密码是正确的......
好的,看来我找到了问题的解决方案,它与我提供的 Sharepoint URL 有关。
如果我们举这个例子:https://www.mysharepoint.com/Your/SharePoint/DocumentLibrary
您必须删除最后一部分:/DocumentLibrary
.
为什么要精确去除这部分呢?
事实上,当您深入了解 Sharepoint 时,您的 url 将类似于:https://www.mysharepoint.com/Your/SharePoint/DocumentLibrary/Forms/AllItems.aspx?RootFolder=%2FYour%2FSharePoint%2DocumentLibrary%2FmyPersonnalFolder&FolderCTID=0x0120008BBC54784D92004D1E23F557873CC707&View=%7BE149526D%2DFD1B%2D4BFA%2DAA46%2D90DE0770F287%7D
你可以看到路径的右边是在RootFolder=%2FYour%2FSharePoint%2DocumentLibrary%2Fmy%20personnal%20folder
并且不再在“正常”URL 中(如果是的话,就会像这样https://www.mysharepoint.com/Your/SharePoint/DocumentLibrary/myPersonnalFolder/
).
您必须删除的是“正常”URL 的末尾,因此在这种情况下,/DocumentLibrary
.
所以我在 SharePlum 中输入的正确 Sharepoint URL 是https://www.mysharepoint.com/Your/SharePoint/
我对 Sharepoint 还很陌生,所以我不太确定这是否是其他人解决此问题的正确答案,比我更了解 Sharepoint 的人可以确认吗?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)