2

I am attempting to download the Amiens logo from the Ligue 1 website as a PNG using Python. My code is as follows:

import pathlib
import request
logo_url = 'http://www.ligue1.com/images/photos/clubs/logo/grand/500240.png'
filepath = playerimagesfile + '\\Ligue 1'
imagepath = playerimagesfile + '\\Ligue 1\\Amiens.png'
pathlib.Path(filepath).mkdir(parents=True, exist_ok=True) 
request.urlretrieve(logo_url, imagepath)

However, I get this error:

URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>

urlretrieve only takes the following arguments (url[, filename[, reporthook[, data]]]) and none of them appear to be useful for getting around this certificate verification failure. How is the best way of approaching this?

OD1995
  • 1,647
  • 4
  • 22
  • 52
  • possible duplicate of https://stackoverflow.com/questions/33770129/how-do-i-disable-the-ssl-check-in-python-3-x – gogaz Aug 20 '18 at 14:43
  • Does this answer your question? [How do I disable the ssl check in python 3.x?](https://stackoverflow.com/questions/33770129/how-do-i-disable-the-ssl-check-in-python-3-x) – mx0 Mar 05 '21 at 13:17

0 Answers0