requests1 Requests requests 모듈 : 웹 페이지의 HTML 코드를 파이썬으로 가져올 수 있게 하는 모듈. 1 2 3 4 5 response = requests.get("http://www.tistory.com") response.raise_for_status() #requests 응답값이 문제가 생기면 에러코드 출력하면서 종료, 문제 없으면 넘어간다. response.status_code #응답코드, 200이면 정상코드 response.text #HTML코드 출력 Colored by Color Scripter cs 1 2 3 4 5 response = requests.get("http://www.tistory.com") #티스토리 페이지의 html 코드를 가져와서 html파일 생성 with open("tistory... 2021. 5. 27. 이전 1 다음