"icao": "LFPG",
"observed": "2020-01-15T13:00:00.000Z",
"raw_text": "LFPG 151300Z 21023G34KT CAVOK 12/05 Q1012 NOSIG",
"station": {
"name": "Charles de Gaulle International"
"clouds": [
"code": "CAVOK",
"text": "Clear skies"
"flight_category": "VFR",
"conditions": []
My current code is the following:
import requests
import json
hdr = my_header_here
req = requests.get("url", headers=hdr)
metarJSON = json.loads(req.text)
我所要做的是
print(metarJSON["data"][0]["wind"]["degrees"])
非常感谢你,从上周开始,我就是一个完全的python初学者了:)
1 个回答
0 人赞同
json.loads()
解析json字符串并返回一个字典,所以你可以用这种方式访问数值。
parsed = json.loads(req.text)