python獲取天氣的兩種方法

import requests r = requests.get('http://www.weather.com.cn/data/sk/101070201.html') r.encoding='utf-8' print(r.json()) 請求連接中的數字對應相應的城市代碼,想查詢其餘城市代碼可經過中國天氣網http://www.weather.com.cn查詢相應城市的天氣,而後複製瀏覽器地址欄
相關文章
相關標籤/搜索