1

I installed the Wikipedia-API but I can't get it to work. If I try and use any method on 'page' it gives me an error. This is the only code I have in the project.

import wikipediaapi

wiki_wiki = wikipediaapi.Wikipedia('en')

page = wiki_wiki.page('Mathematics')
print(page.summary)

Here is the error

requests.exceptions.SSLError: HTTPSConnectionPool(host='en.wikipedia.org', port=443): Max retries exceeded with url: /w/api.php?titles=Mathematics&exsectionformat=wiki&explaintext=1&format=json&redirects=1&prop=extracts&action=query (Caused by SSLError(SSLError(1, '[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645)'),))
  • Check this one, might help you out: https://stackoverflow.com/questions/44316292/ssl-sslerror-tlsv1-alert-protocol-version – Klatten Jun 18 '20 at 05:55

2 Answers2

1

I was able to fix the problem by updating my Python from 3.6 to 3.8 and changing the interpreter within PyCharm.

0

your code is fine. I think the problem is something related to certificates. Try upgrading your pyOpenSSL version. Using this command.

pip install pyOpenSSL --upgrade

It will solve your issue!

Ransaka Ravihara
  • 1,786
  • 1
  • 13
  • 30