我有一个来自 Weather API 的 json 响应。我想获取特定属性的数据,这是响应:
{
"response": {
"version": "0.1",
"termsofService": "http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"forecast": 1
}
},
"forecast": {
"txt_forecast": {
"date": "2:00 PM PDT",
"forecastday": [
{
"period": 0,
"icon": "partlycloudy",
"icon_url": "http://icons-ak.wxug.com/i/c/k/partlycloudy.gif",
"title": "Tuesday",
"fcttext": "Partly cloudy in the morning, then clear. High of 68F. Breezy. Winds from the West at 10 to 25 mph.",
"fcttext_metric": "Partly cloudy in the morning, then clear. High of 20C. Windy. Winds from the West at 20 to 35 km/h.",
"pop": "0"
},
{
"period": 1,
"icon": "partlycloudy",
"icon_url": "http://icons-ak.wxug.com/i/c/k/partlycloudy.gif",
"title": "Tuesday Night",
"fcttext": "Mostly cloudy. Fog overnight. Low of 50F. Winds from the WSW at 5 to 15 mph.",
"fcttext_metric": "Mostly cloudy. Fog overnight. Low of 10C. Breezy. Winds from the WSW at 10 to 20 km/h.",
"pop": "0"
}......
我想得到预测: txt_forecast : fcttext我想从上面的响应中得到“fcttext”。我可以使用下面的代码得到日期。
var date = parsed_json['forecast']['txt_forecast']['date'];
请帮助我如何从响应中获取“fcttext”。