The python code (python3)
import time
import urllib.response, requests
from config.dev import CONTENT_IMAGE_UPLOAD
directory = CONTENT_IMAGE_UPLOAD + "en_" + time.strftime('%Y%m%d')
filename = "sample.jpg"
try:
urllib.request.urlretrieve("https://www.miamiherald.com/latest-news/wfeh98/picture238148999/alternates/LANDSCAPE_1140/Screenshot%20(150).png", directory + "/" + filename)
print("image is saved")
except Exception as e:
print(e)
I am expecting to get the image in just less than one minute , but it take too long
then print output as message like below.
[Errno 60] Operation timed out
I am sure the image is already exist because when I copied and pasted I got the image,
but it seem the URL contains some special char in this part Screenshot%20(150).png
,
How could I solve this error?