[크롤링] Python의 requests 모듈 기본 사용법
우선 requests 모듈이 설치가 되어 있지 않다면 별도로 설치를 해주어야 합니다. pip install requests 그리고 requests 모듈을 사용해서 구글 페이지를 요청해보고, 잘 요청되었다면 받아온 응답을 html 파일로 저장해보겠습니다. import requests res = requests.get("http://google.com") res.raise_for_status() # 응답코드 200(정상)이 아니면 예외처리 및 프로그램 종료 print(len(res.text)) with open("google.html", "w", encoding="utf8") as f: f.write(res.text) 위 코드를 잠깐 설명하자면, requests.get 함수를 사용해서 google.com 페..