Skip to content Skip to sidebar Skip to footer

Disambiguationerror And Guessedatparserwarning In Wikipedia Api In Python

I want to get a list of possible and acceptable names that Wikipedia has related to the search term. 'Corona' in this case. When typing this: print(wikipedia.summary('Corona')) Thi

Solution 1:

First, install the module from the PyPI using pip install wikipedia. Once installed the module import wikipedia Then print(wikipedia.summary("Corona"))

If you have fulfilled the above requirements and still the error happens do the following

import warnings

warnings.catch_warnings()

warnings.simplefilter("ignore")

still, the error has occurred use exception handling:

try:
 print(wikipedia.summary("Corona"))
except wikipedia.exceptions.DisambiguationError as e:
  print(e.options)

Post a Comment for "Disambiguationerror And Guessedatparserwarning In Wikipedia Api In Python"