update,
This commit is contained in:
18
task1/archive/task1_fufill_question.py
Normal file
18
task1/archive/task1_fufill_question.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# https://api.data.gov.hk/v1/carpark-info-vacancy?data=vacancy&vehicleTypes=privateCar
|
||||
import requests
|
||||
from pprint import pprint
|
||||
|
||||
url = "https://api.data.gov.hk/v1/carpark-info-vacancy"
|
||||
params = {
|
||||
"data": "vacancy",
|
||||
"vehicleTypes": "privateCar"
|
||||
}
|
||||
|
||||
response = requests.get(url, params=params)
|
||||
js_result = response.json()['results']
|
||||
|
||||
|
||||
js_row = js_result[0]
|
||||
|
||||
pprint(js_row)
|
||||
pprint("length of json: "+str(len(js_result)))
|
Reference in New Issue
Block a user