Commonists / pageview-api

Wikimedia Pageview API client
MIT License
27 stars 7 forks source link

API crashes when page title contains special characters like / and ? #6

Open abhi12ravi opened 3 years ago

abhi12ravi commented 3 years ago

Hi Team,

I was recently using the pageviewapi for my project and found that whenever the Wikipedia page title had special characters like / or ?, it throws an error saying ZeroOrDataNotLoadedException. Is that by design or is something amiss?

Please do let me know if I have missing something.

In the below example, I’m trying to pass ‘9/11 conspiracy theories’ as the page title. However, the per_article method throws a ZeroOrDataNotLoadedException.

Kindly let me know if you need any further information to resolve this issue.

Regards, Abhiram

Screenshot:

image

inkrement commented 2 years ago

Hi, I encountered the same issue. However, there is an easy workaround. Just encode your slashes using url-encoding (e.g., write AC%2FDC instead of AC/DC). Hope this helps.