■ urlopen 함수를 사용해 웹 페이지를 다운로드하는 방법을 보여준다.
▶ 예제 코드 (PY)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import urllib.request as request httpResponse = request.urlopen("http://www.example.com") htmlBytes = httpResponse.read() httpResponse.close() html = str(htmlBytes).encode("utf-8").decode("cp949") print(html) |