好用的天气插件www.tianqi.com/plugin/

1、好用的天气插件https://www.tianqi.com/plugin/

根据访问IP地址可以判断当地的天气,生成天气预报信息放到页面上。

2、天气预报接口:

import requests

URL="http://wthrcdn.etouch.cn/weather_mini?city=北京"
print(requests.get(URL).text)
json_data= requests.get(URL).json()
print(json_data['data']['yesterday'])
for i in json_data['data']['forecast']:
    print(i)

 

posted on 2020-07-19 10:55  sdlyxyf  阅读(560)  评论(0编辑  收藏  举报

导航