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

Error #321

Open
lxianl455 opened this issue Mar 15, 2023 · 2 comments
Open

Error #321

lxianl455 opened this issue Mar 15, 2023 · 2 comments

Comments

@lxianl455
Copy link

I just try:
import wikipedia
print(wikipedia.summary("google", sentences=1))

but i got the follow error:

raise PageError(self.title)
wikipedia.exceptions.PageError: Page id "google" does not match any pages. Try another id!

What should i do?

@lxianl455
Copy link
Author

Now I try another word, like apple. But the result is wrong:

search_params {'list': 'search', 'srprop': '', 'srlimit': 1, 'limit': 1, 'srsearch': 'apple', 'srinfo': 'suggestion'}
In mathematics and computer science, apply is a function that applies a function to arguments.

@theptrk
Copy link

theptrk commented Aug 21, 2024

For "google" the suggestion is google\\ (but not sure why)
Screenshot 2024-08-21 at 4 00 57 PM

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

No branches or pull requests

2 participants