requests
-
Python 세션 유지 (Request 모듈 사용)Python 2022. 12. 27. 10:22
Request 모듈을 사용한 Python 세션 유지 1. Session 설명 세션(Session)은 HTTP 요청과 응답 사이에 유지되는 상태 정보를 저장할 수 있는 기능이다. 세션은 웹 사이트에 접근할 때 사용자 인증이 필요한 경우, 접근 제한이 걸려 있거나, 상태 mallard53.tistory.com 블로그 이전으로 위 링크로 대체합니다. import requests # 세션을 생성합니다. session = requests.Session() # 세션을 사용해서 메인 페이지를 요청합니다. response = session.get("https://www.example.com") # 응답의 HTML 코드를 출력합니다. print(response.text) # 세션을 종료합니다. session.close(..