Wikipedia page id in wikipedia.page error does not match search query
See original GitHub issueTrying to access a valid wikipedia page (with redirect, see https://en.wikipedia.org/wiki/Petawatt) this error is thrown:
>>> wikipedia.page("Petawatt")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/.local/share/virtualenvs/quantulum3-mx2jnqkR/lib/python3.6/site-packages/wikipedia/wikipedia.py", line 276, in page
return WikipediaPage(title, redirect=redirect, preload=preload)
File "/home/user/.local/share/virtualenvs/quantulum3-mx2jnqkR/lib/python3.6/site-packages/wikipedia/wikipedia.py", line 299, in __init__
self.__load(redirect=redirect, preload=preload)
File "/home/user/.local/share/virtualenvs/quantulum3-mx2jnqkR/lib/python3.6/site-packages/wikipedia/wikipedia.py", line 345, in __load
raise PageError(self.title)
wikipedia.exceptions.PageError: Page id "per watt" does not match any pages. Try another id!
The PageError contains a wrong id following this legitimate search query. This does not occur if auto_suggest is turned off. Anyway the title shouldn’t be changed in the pageerror on my opinion.
>>> wikipedia.page("Petawatt", auto_suggest=False)
<WikipediaPage 'Watt'>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:8
Top Results From Across the Web
python - Loading page from wikipedia search query errors ...
I fixed this error by looking at the github solved issues. When running the below line auto suggest is set automatically to true...
Read more >Wikipedia:Page name
Page name is a term that is used to refer to any page that is sent from a Wikipedia database. It does not...
Read more >wikipedia 0.9 documentation
Exception raised when no Wikipedia matched a query. exception wikipedia.exceptions. RedirectError (title)¶. Exception raised when a page title ...
Read more >Wikipedia-API - PyPI
Class WikipediaPage has property summary, which returns description of Wiki page. import wikipediaapi wiki_wiki = wikipediaapi.Wikipedia('en') ...
Read more >Python Programing Hello. I'm having a problem | Chegg.com
I'm trying to use Python library called Wikipedia its wrapper for Wikipedia API. ... Page id lexus company does not match any pages...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah I find that I need to set
auto_suggest=False
when I know the page names I have exist, i.e. I’ve gotten the names fromwikipedia.search()
.wikipedia.summary(Query, sentences=2, auto_suggest=False, redirect=True), It’s working!