You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
512 B
Python
16 lines
512 B
Python
import requests
|
|
import json
|
|
|
|
r = requests.get("http://opendata.cwb.gov.tw/api/v1/rest/datastore/F-D0047-061?Authorization=CWB-6B764FB3-BD6E-4198-96C0-43FB4EBA1375&limit=10&offset=0&format=JSON&elementName=T&sort=time", verify=False)
|
|
list_of_dicts = r.json()
|
|
|
|
# print(type(r))
|
|
# print(type(list_of_dicts2))
|
|
new_list = list(list_of_dicts["records"]["locations"])
|
|
# for i in new_list:
|
|
# print(i["locationsName"])
|
|
print(new_list)
|
|
# print(list_of_dicts)
|
|
# for i in list_of_dicts:
|
|
# print(i["weatherElement"])
|