When I use:
import requests
r = requests.get("https://example.com")
I get the following exception:
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
However, If i use following code:
url = "https://www.example.com"
request = urllib.request.urlopen(url)
It gives me the correct response[200] code. Why is it so? What is the difference between these two methods and which one should be preferred?