goldsmith / Wikipedia

A Pythonic wrapper for the Wikipedia API
https://wikipedia.readthedocs.org/
MIT License
2.89k stars 519 forks source link

terrible module, multiple errors #276

Closed KebabLord closed 3 years ago

KebabLord commented 3 years ago

wikipedia.page object's sections always return empty list.

>>> p = wikipedia.page(title="Ataturk")
>>> p.sections
[]

Turns search keys into awful strings such as Soros to sorts, Adolf hitler to -hitler

>>> wikipedia.page(title="George Soros")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/owo/.local/lib/python3.7/site-packages/wikipedia/wikipedia.py", line 276, in page
    return WikipediaPage(title, redirect=redirect, preload=preload)
  File "/home/owo/.local/lib/python3.7/site-packages/wikipedia/wikipedia.py", line 299, in __init__
    self.__load(redirect=redirect, preload=preload)
  File "/home/owo/.local/lib/python3.7/site-packages/wikipedia/wikipedia.py", line 345, in __load
    raise PageError(self.title)
wikipedia.exceptions.PageError: Page id "george sorts" does not match any pages. Try another id!
>>> p = wikipedia.page(title="Adolf hitler")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/owo/.local/lib/python3.7/site-packages/wikipedia/wikipedia.py", line 276, in page
    return WikipediaPage(title, redirect=redirect, preload=preload)
  File "/home/owo/.local/lib/python3.7/site-packages/wikipedia/wikipedia.py", line 299, in __init__
    self.__load(redirect=redirect, preload=preload)
  File "/home/owo/.local/lib/python3.7/site-packages/wikipedia/wikipedia.py", line 345, in __load
    raise PageError(self.title)
wikipedia.exceptions.PageError: Page id "adolf -hitler" does not match any pages. Try another id!
>>> 
tcrch commented 9 months ago

this is so mean for no reason šŸ˜­šŸ˜­šŸ˜­šŸ˜­