查看天气的代码

                                              查看天气的代码                                                     

 

 

import requests
import json

ret = requests.get('http://wthrcdn.etouch.cn/weather_mini?city=上海')
ret.encoding = 'utf-8'
s1 = ret.text
print(s1,type(s1))

d1 = json.loads(s1)
print(d1,type(d1))

 

  

 

posted @ 2018-06-25 17:25  萧白白  阅读(161)  评论(0编辑  收藏  举报