1
我使用wikitools
包解析维基百科。我只是从文档中复制这个例子。但它不工作。当我运行这个代码。我得到以下错误。 Invalid JSON,trying requesting again
。你能帮我么 ?谢谢wikitools解析错误
from wikitools import wiki
from wikitools import api
# create a Wiki object
site = wiki.Wiki("http://my.wikisite.org/w/api.php")
# define the params for the query
params = {'action':'query', 'titles':'Papori'}
# create the request object
request = api.APIRequest(site, params)
# query the API
result = request.query()
是那整个代码?当我运行它时,我得到'TypeError:序列项目0:期望的字符串,int在5秒内再次尝试请求 TypeError:序列项目0:期望的字符串,int在10秒内再次尝试请求' - 不是你描述的错误。 – jedwards