product · inferred from evidence
goldsmith/Wikipedia
A GitHub repository for a Python library interacting with Wikipedia.
- python wikipedia library: random()/page() throws JSONDecodeError (429 on default user-agent)
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 de
- Handling DisambiguationError in the python wikipedia library
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.Disambiguati