MDD
MDD

Reputation: 23

Python Can't connect to HTTPS URL because the SSL module is not available HTTPSConnectionPool(url , port=443)

my Python code:

import requests
from bs4 import BeautifulSoup

url = 'http://pythondojang.bitbucket.io/weather/observation/currentweather.html'
response =  requests.get(url, verify=False)
soup= BeautifulSoup(response.content, 'html.parser')
print(soup)

error message:

HTTPSConnectionPool(host='pythondojang.bitbucket.io', port=443): Max retries exceeded with 
url: /weather/observation/currentweather.html (Caused by SSLError("Can't connect to HTTPS URL 
because the SSL module is not available."))

During handling of the above exception, another exception occurred:


During handling of the above exception, another exception occurred:

File "C:\work\python\practice\ReadHTML.py", line 5, in <module> (Current frame)
response =  requests.get(url, verify=False)

Done:

pip install requests --upgrade
pip install pyOpenSSL --upgrade
python version = 3.8.8
request version = 2.26.0
openssl version = 1.1.1k 
pyopenssel version = 21.0.0 

OS:window 10 i try to many search in google but fail Can anyone assist me to resolve this error?

Upvotes: 1

Views: 859

Answers (1)

AleBuo
AleBuo

Reputation: 220

The problem is the site is not a "HTTPS".

Change the URL to :

url = 'https://pythondoj........

The PORT 443 only work port secure socket.

Tell me if it was useful. Greetings

Upvotes: 1

Related Questions