爬取网页页面结构
import urllib.request
# 可以是 from urllib import request,语句等价
response = urllib.request.urlopen('https://www.baidu.com/')
print(response.read().decode('utf-8'))
发起get请求
import requests
ret = requests.get('http://localhost:8088/chengdu.json')
print(ret.url)
print(ret.text)