'''
第一個示例:簡單的網頁爬蟲
'''
import urllib.request
#網址
url = "http://www.chinadaily.com.cn/a/201906/20/WS5d0acc47a3103dbf1432936b.html"
#請求
request = urllib.request.Request(url)
#爬取結果
response = urllib.request.urlopen(request)
data = response.read()
#設置解碼方式
data = data.decode('utf-8')
#打印結果
print(data)
#打印爬取網頁的各類信息
print(type(response))
print(response.geturl())
print(response.info())
print(response.getcode())