goldsmith / Wikipedia

A Pythonic wrapper for the Wikipedia API
https://wikipedia.readthedocs.org/
MIT License
2.88k stars 519 forks source link

Max retries exceeded with url: /w/api.php? #294

Open dengwen168 opened 2 years ago

dengwen168 commented 2 years ago

I am using

import wikipedia result = wikipedia.summary(kw,sentences=10) but I get a error message:

HTTPSConnectionPool(host='en.wikipedia.org', port=443): Max retries exceeded with url: /w/api.php?list=search&srprop=&srlimit=1&limit=1&srsearch=twotooth+achyranthes+root&srinfo=suggestion&format=json&action=query (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),))

How to solve this problem? thanks.

karlkovaciny commented 2 years ago

For me this was caused by a cloud security program that only allows SSL traffic verified with its own certificates (ZScaler). You can see how to put ZScaler's certificate into the one used by Python at https://community.zscaler.com/t/installing-tls-ssl-root-certificates-to-non-standard-environments/7261. You can see how to transform the cert into a .pem with https://knowledge.digicert.com/solution/SO26449.html.