일단 무슨 에러인지 확인해야 합니다.
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)
error connecting : ('connection aborted.', connectionreseterror(10054, '현재 연결은 원격 호스트에 의해 강제로
python error입니다. 가장 많이 추천하는 해결방법은 http header의 설정을 추가하는 것입니다. test_link = "" headers = { "User-Agent": "지금 해더 추가", "Accept-Encoding": "*", "Connection": "keep-alive..
jacorinne.tistory.com
error connecting : ('connection aborted.', timeouterror(10060, '연결된 구성원으로부터 응답이 없어 연결하지
python requests 함수에 에러가 나옵니다. 이는 여러가지 원인이 있습니다. 1. 많은 인터넷 연결 문제 2. 서버 세팅 문제 3. 인터넷 속도 문제 등 많은 원인이 있는 만큼 잡기 힘든 에러입니다. 저의 해
jacorinne.tistory.com
참조 : https://calssess.tistory.com/92
python) requests Exception 잡아내기
보통 네트워크 통신을 위해 requests를 많이들 쓴다. import requests 당연히도 통신을 한다면 오류가 뜨는 Exception을 잡아야한다. https://requests.readthedocs.io/en/latest/user/quickstart/#errors-and-exc..
calssess.tistory.com