目前,我正试图从佐马托API中的"best_restaurant“列表中获取唐熙华餐厅的名称和地址。
我试过了
response = requests.get(url, headers=header)
data = (response.json())
# print(data)
for item in data["best_rated_restaurant"]:
print item["name"]我正在接收"best_rated_restaurant“的数据,但不知道如何在数据中获取特定的值。
有没有人知道我会如何检索数据中的信息,如姓名、地址、菜肴等?
发布于 2017-03-22 17:24:24
你就快到了
for item in data["best_rated_restaurant"]:
print item['restaurant']['name']
print item['restaurant']['location']['address']
print item['restaurant']['cuisines']https://stackoverflow.com/questions/42958415
复制相似问题