当页面肯定存在时运行此代码错误,因为我使用python维基百科库首先获取页面。
import wikipedia
wikiResults = wikipedia.search("megaman 64")
result = wikiResults[0]
page = wikipedia.page(result)
错误返回:
wikipedia.exceptions.PageError: Page id "mega man legends video games" does
not match any pages. Try another id!
我究竟做错了什么?
谢谢
编辑:提供MCVE
我通过查看github解决的问题修复了这个错误。
运行以下行时,auto建议自动设置为true
page = wikipedia.page(result)
禁用此功能可解决此问题:
page = wikipedia.page(result, auto_suggest=False)