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?