Skip to content
조회 수 3648 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

파이썬 웹크롤링 오류 대처방법

 

requests.exceptions.SSLError: HTTPSConnectionPool(host='www.khnp.co.kr', port=443): Max retries exceeded with url: /RECU_NEW/RECU_NEW?cmdn=NEW_BQ10 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: 

CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

 

 

계속 오류가 발생하여

requests에 

verify=False

넣어주니 정상 출력됩니다.

 

 

#https://www.khnp.co.kr/RECU_NEW/RECU_NEW?cmdn=NEW_BQ10
url = "https://www.khnp.co.kr/RECU_NEW/RECU_NEW?cmdn=NEW_BQ10"
headers = {
    'Accept''text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
    'Accept-Encoding''gzip, deflate, br',
    'Accept-Language''ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7',
    'Cache-Control''max-age=0',
    'Connection''keep-alive',
    'Cookie''_ga=GA1.3.1345281943.1598146999; WCN_KHNPHOME=QkrtkGFs0nLNfj768SbVmQxr1OIQpvJie6TiuEk3bu84v_vPDIa-!-1184041201; _gid=GA1.3.270150670.1631778271; WCN_RECU_NEW=nKTtlGf4CrAf9URFkArymhC8ylIFHyv1pMWEmGfcEosfnWqQDFJh!-681835361',
    'Host''www.khnp.co.kr',
    'Referer''https://search.naver.com/search.naver?where=nexearch&sm=top_hty&fbm=1&ie=utf8&query=%ED%95%9C%EC%88%98%EC%9B%90+%EC%B1%84%EC%9A%A9',
    'User-Agent''Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.3'
    }
html = requests.get(urlheaders=headers,verify=False)  
bs_html = BeautifulSoup(html.content,"html.parser")
 
temp = bs_html.find("tbody")
print(temp)

 

 

 

로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
857 AutoHotKey autohotkey) postmessage mouse control 13 2012.02.22 28637
856 AutoHotKey autohotkey) Virus? 6 2011.12.31 34687
855 AutoHotKey autohotkey) WinSpector spy를 이용한 post,sendmessage Control ID 추출하기 3 file 2012.02.22 10906
854 AutoHotKey autohotkey) 네 코드를 보여, 내가 당신에게서 배우고 싶어요 1 2012.01.08 15117
853 AutoHotKey autohotkey) 런처시스템 3 2012.05.30 14295
852 AutoHotKey autohotkey) 맥어드레스 추출 2 2011.12.21 15085
851 AutoHotKey autohotkey) 스크린세이버 활성화 / 비활성화 시키기. 2012.03.17 8059
850 AutoHotKey autohotkey) 오토핫키에서 자주쓰는 함수모음 2013.10.30 33716
849 AutoHotKey autohotkey) 웹페이지의 프레임 내용보기 & 클릭하기 2011.11.29 15155
848 AutoHotKey autohotkey) 윈도우 ahk_id 추출하기 2 2012.03.06 30099
847 AutoHotKey autohotkey) 파일리스트 가져오기 3 2012.11.26 14997
846 AutoHotKey autohotkey) 편입 변수 4 2012.03.13 28918
845 AutoHotKey autohotkey) 핑테스트 프로그램 1 file 2011.12.31 18955
844 AutoHotKey autohotkey) 화면보호기 실행 전 클릭으로 화면보호 안걸리게 하기 2012.03.15 8875
843 AutoHotKey Autohotkey) 화면보호기(ScreenSaver) On/Off 방법 17 2012.03.16 40721
842 AutoHotKey autohotkey) 화면보호기, 바탕화면 control 창 열기 3 2012.03.17 8366
841 AutoHotKey autohotkey)매월 1일의 요일 구하기 1 2013.01.27 15278
840 AutoHotKey Autohotkey] 키보드 후킹 테스트 file 2018.07.07 9694
839 AutoHotKey autohotkey_L Object 2011.02.21 15394
838 AutoHotKey AutoHotkey_L: Arrays, Debugger, x64, COM, #If expression 3 2011.02.14 21595
Board Pagination Prev 1 2 3 4 5 6 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소