랭귀지/python
파이썬 3에서 urllib로 url 열기
유키공
2019. 5. 9. 11:39
파이썬 3에서 urllib로 url 열기(opening a url with urllib in python 3)
Python 3에서는 다음과 같이 구현할 수 있습니다.
Python 3에서는 다음과 같이 구현할 수 있습니다.
#-*- coding: utf-8 -*-
'''
Created on 2019. 05. 09.
@author: bhm
'''
import urllib.request
try:
u = urllib.request.urlopen("https://www.naver.com")
print(u.read())
except Exception as e:
print(e)