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

wikipedia api searh #314

Open
Felikesw opened this issue Sep 29, 2022 · 1 comment
Open

wikipedia api searh #314

Felikesw opened this issue Sep 29, 2022 · 1 comment

Comments

@Felikesw
Copy link

This is my code:

import wikipedia
wikipedia.summary("theresa may")

but for some reasons, it ran into error, and saying that I am giving "teresa may" as input???

PageError: Page id "teresa may" does not match any pages. Try another id!

What is going on here?

image

@Felikesw
Copy link
Author

I did some digging, and end up in the query within the search function. The incorrect suggestion came from here:

 search_params = {
    'list': 'search',
    'srprop': '',
    'srlimit': results,
    'limit': results,
    'srsearch': query
  }
  if suggestion:
    search_params['srinfo'] = 'suggestion'

  raw_results = _wiki_request(search_params)

here is the content of raw_results, given the input "theresa may":
image

Notice that the suggestion field in the returning query has the incorrect suggestion. Not sure how to furthur debug this

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

1 participant