Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Creatity page not found" when retrieving page for "Creativity" #304

Open
hobson opened this issue Feb 24, 2022 · 1 comment · May be fixed by #305
Open

"Creatity page not found" when retrieving page for "Creativity" #304

hobson opened this issue Feb 24, 2022 · 1 comment · May be fixed by #305

Comments

@hobson
Copy link

hobson commented Feb 24, 2022

python 3.7.9

>>> import wikipedia
>>> wikipedia.__version__
1.4.0

Some pages can't be found, even if you use the exact title currently on Wikipedia for a popular page or use the .suggested article title:

>>> wikipedia.summary('Creativity')
PageError: Page id "creatity" does not match any pages. Try another id!
>>> wikipedia.page('Creativity')
PageError: Page id "creatity" does not match any pages. Try another id!
>>> wikipedia.suggest('Creativity')
'creatity'
>>> wikipedia.search('Creativity')
['Creativity',
 'Creativity (religion)',
 'Creativity and mental health',
...
PageError: Page id "creatity" does not match any pages. Try another id!
>>> wikipedia.page('creativity')
PageError: Page id "creatity" does not match any pages. Try another id!

Lowercasing, etc. doesn't help, but adding the "(religion)" qualifier does, unless you're not looking for the religion page.
Installing with conda or pip gives the same behavior.

@theptrk
Copy link

theptrk commented Aug 21, 2024

For "Creativity" the suggestion is "creatity" (but not sure why)

The error seems to stem from here.

Someone should just make a PR that changes that priority.

Its right here:

title = suggestion or results[0]

    if auto_suggest:
      results, suggestion = search(title, results=1, suggestion=True)
      try:
        title = suggestion or results[0]
      except IndexError:
        # if there is no suggestion or search results, the page doesn't exist
        raise PageError(title)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants