Python 2.7 没有这样的方法:getAuthToken
我正在尝试编写一个脚本,以通过未在我的计算机上运行的MoinMoin Wiki进行身份验证。根据官方MoinMoin wiki页面上的信息(见第3.11节),我假设我的方法是正确的 我的代码如下:Python 2.7 没有这样的方法:getAuthToken,python-2.7,xmlrpclib,moinmoin,Python 2.7,Xmlrpclib,Moinmoin,我正在尝试编写一个脚本,以通过未在我的计算机上运行的MoinMoin Wiki进行身份验证。根据官方MoinMoin wiki页面上的信息(见第3.11节),我假设我的方法是正确的 我的代码如下: import ssl import xmlrpclib def getCustomerPages(): #list of page names: pageNames = [] #setup MoinMoin: name = "username" passw
import ssl
import xmlrpclib
def getCustomerPages():
#list of page names:
pageNames = []
#setup MoinMoin:
name = "username"
password = "password"
wikiUrl = "url"
myWiki = xmlrpclib.ServerProxy(wikiUrl + "?action=xmlrpc2", allow_none = True,
context=ssl._create_unverified_context())
authToken = myWiki.getAuthToken(name, password)
print(authToken)
mc = xmlrpclib.MultiCall(myWiki)
mc.applyAuthToken(authToken)
getCustomerPages()
值得注意的是,我尝试连接到的wiki没有良好的SSL证书。因此,我在xmlrpclib.ServerProxy()
当我运行此代码时,会出现以下错误:
{'faultCode': 1, 'faultString': 'No such method: getAuthToken.'}
我查看了其他代码,他们似乎使用的方法很好,但基本上与我的代码相同。有关其用法的示例,请参见
有人能帮我理解并修复这个错误吗