urllib简单案例
上一节
下一节
获取北京天气预报
import urllib.request
web=urllib.request.urlopen('http://www.weather.com.cn/data/cityinfo/101010100.html')
print(web.read().decode('utf-8'))

可以简写为:
import urllib.request
print(urllib.request.urlopen('http://www.weather.com.cn/''data/cityinfo/101010100.html').read().decode('utf-8'))

