gpt4 book ai didi

python - wikipedia.getSite() 的替代品是什么?或者它还能用吗?

转载 作者:太空宇宙 更新时间:2023-11-03 15:30:09 25 4
gpt4 key购买 nike

我运行了 pywikibot 示例代码,但由于 AttributeError 而中止。回溯是...

Traceback (most recent call last):
File "pwb.py", line 270, in <module>
if not main():
File "pwb.py", line 264, in main
run_python_file(filename, [filename] + args, argvu, file_package)
File "pwb.py", line 109, in run_python_file
main_mod.__dict__)
File ".\cochonBot.py", line 81, in <module>
main()
File ".\cochonBot.py", line 52, in main
stub_list = cat_list_rec(u'遺꾨쪟:?좊쭑湲 遺꾨쪟', stub_ignore_cats)
File ".\cochonBot.py", line 14, in cat_list_rec
cat = catlib.Category(wikipedia.getSite(), top_cat)
AttributeError: 'module' object has no attribute 'getSite'
<type 'exceptions.AttributeError'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort

wikipedia.getSite() 的替代品是什么?还是还能用?

最佳答案

您可以简单地使用pywikibot.Site()来代替。

关于python - wikipedia.getSite() 的替代品是什么?或者它还能用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42943456/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com