Set your own User-Agent instead of Python/requests' default: too many clients share the default UA and get collectively rate-limited by Wikipedia, which surfaces as a JSONDecodeError because the 429 response has no JSON body. Configure a descriptive UA per the Wikimedia user-agent policy (identify y…
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 c…
Set your own User-Agent instead of Python/requests' default: too many clients share the default UA and get collectively rate-limited by Wikipedia, which surfaces as a JSONDecodeError because the 429 response has no JSON body. Configure a descriptive UA per the Wikimedia user-agent policy (identify y…
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 c…