I'm trying to access https but I got "certificate verify failed". Here's my code:
from bs4 import BeautifulSoup
import requests
url = 'https://covidlive.com.au/report/daily-cases/vic'
html = requests.get(url).content
bs = BeautifulSoup(html, 'html.parser')
The error I received:
SSLError: HTTPSConnectionPool(host='covidlive.com.au', port=443): Max retries exceeded with url: /report/daily-cases/vic (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))
If I change my code to:
html = requests.get(url,verify=False).content
I won't see the error but this is not what I want Per the discussion here: Python SSL certificate verify error , I believe my case needs to "add CA in the trusted list for the requests library". And the example code is:
r = requests.post(url, data=data, verify='/path/to/public_key.pem')
I'm using win10. I checked the information here: https://www.globalsign.com/en/blog/how-to-view-ssl-certificate-details But still I don't know how can I find the .pem file on my PC.
Can you please help?