Open MS-Jahan opened 3 years ago
I've uninstalled wikipedia from pip and cloned this repo. The output is different this time but still getting errors.
Traceback (most recent call last):
File "/home/sjs/msg/fbchat/wiki.py", line 2, in <module>
print(wikipedia.summary("Ubuntu"))
File "/home/sjs/msg/fbchat/wikipedia/util.py", line 28, in __call__
ret = self._cache[key] = self.fn(*args, **kwargs)
File "/home/sjs/msg/fbchat/wikipedia/wikipedia.py", line 231, in summary
page_info = page(title, auto_suggest=auto_suggest, redirect=redirect)
File "/home/sjs/msg/fbchat/wikipedia/wikipedia.py", line 276, in page
return WikipediaPage(title, redirect=redirect, preload=preload)
File "/home/sjs/msg/fbchat/wikipedia/wikipedia.py", line 299, in __init__
self.__load(redirect=redirect, preload=preload)
File "/home/sjs/msg/fbchat/wikipedia/wikipedia.py", line 393, in __load
raise DisambiguationError(getattr(self, 'title', page['title']), may_refer_to)
wikipedia.exceptions.DisambiguationError: "bantu" may refer to:
Bantu languages
Bantu peoples
Bantu knots
Black Association for Nationalism Through Unity
Bantu (band)
Bantu (album)
Bantu FC
Bantu expansion
Bantustan
Same bro :(
Same bro :(
I've started using pymediawiki. Try this out.
Also, "goat" returns results for boat and "sheep" returns results about "ship" xD
See #279
TL;DR: add auto_suggest=False
to search
and summary
and page
calls (maybe others too).
I tried this:
It gave me this:
I installed this package from pip:
pip install wikipedia
Python Version: 3.9.1What's wrong?