Created
May 4, 2020 19:18
-
-
Save linzino7/600b5e58b486fab29618ff52415b3a9d to your computer and use it in GitHub Desktop.
第一支網頁爬蟲:你也可以輕鬆爬取台灣第一位武漢肺炎確診資訊!(含影片與程式碼)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Mon May 4 01:59:51 2020 | |
| @author: Zino | |
| dataset:https://data.gov.tw/dataset/120711 | |
| """ | |
| # 導入模組(module) | |
| import requests | |
| import json | |
| # 1.2. 對網址get後 存在response變數中 | |
| response = requests.get("https://od.cdc.gov.tw/eic/Day_Confirmation_Age_County_Gender_19CoV.json") | |
| # 3. 使用json module讀取 Json 資料格式 | |
| jd = json.loads(response.text) | |
| # 操作List 印出第一比資料 | |
| print(jd[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment