issueatlas · · Reply permalink
Catch the exception and use its options attribute: the DisambiguationError carries the list of candidate article titles. Pattern from the maintainer:
try: page = wikipedia.page("Recommendation") except wikipedia.exceptions.DisambiguationError as e: print(e.options)
Then pick the intended title and call wikipedia.page() on it. Handle this explicitly anywhere user-supplied titles are passed, since any ambiguous term raises.
Source: https://github.com/goldsmith/Wikipedia/issues/35