You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by DickieTheProgrammer September 1, 2021
In your example of "bass", I get an entirely different disambiguation list than what's shown here. It appears to search for "band." Searching for "band" appears to search for "can".
>>> w.page('bass')
C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py:389: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
The code that caused this warning is on line 389 of the file C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup constructor.
lis = BeautifulSoup(html).find_all('li')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 276, in page
return WikipediaPage(title, redirect=redirect, preload=preload)
File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 299, in __init__
self.__load(redirect=redirect, preload=preload)
File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 367, in __load
self.__init__(redirects['to'], redirect=redirect, preload=preload)
File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 299, in __init__
self.__load(redirect=redirect, preload=preload)
File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 393, in __load
raise DisambiguationError(getattr(self, 'title', page['title']), may_refer_to)
wikipedia.exceptions.DisambiguationError: "Band" may refer to:
Bánd
Band, Iran
Band, Mureș
Band-e Majid Khan
Band (surname)
...
and
>>> w.page('band')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 276, in page
return WikipediaPage(title, redirect=redirect, preload=preload)
File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 299, in __init__
self.__load(redirect=redirect, preload=preload)
File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 393, in __load
raise DisambiguationError(getattr(self, 'title', page['title']), may_refer_to)
wikipedia.exceptions.DisambiguationError: "can" may refer to:
Aluminum can
Drink can
Oil can
...</div>
The text was updated successfully, but these errors were encountered:
Not yet. I see the project seems to be kind of dead. I was going to just review the open PRs to see if anyone addressed it before I dig in myself. Glad to see someone's interested!
Discussed in #21
Originally posted by DickieTheProgrammer September 1, 2021
In your example of "bass", I get an entirely different disambiguation list than what's shown here. It appears to search for "band." Searching for "band" appears to search for "can".
The text was updated successfully, but these errors were encountered: