일단 무슨 에러인지 확인해야 합니다.
import requests
url = 'Your.url.com'
try:
req = requests.get(url)
except requests.exceptions.Timeout as errd:
print("Timeout Error : ", errd)
except requests.exceptions.ConnectionError as errc:
print("Error Connecting : ", errc)
except requests.exceptions.HTTPError as errb:
print("Http Error : ", errb)
# Any Error except upper exception
except requests.exceptions.RequestException as erra:
print("AnyException : ", erra)
참조 : https://calssess.tistory.com/92