Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kdh6115 committed Mar 19, 2020
2 parents c32b4ea + 4adfc34 commit d5a434f
Show file tree
Hide file tree
Showing 7 changed files with 15,208 additions and 5 deletions.
45 changes: 42 additions & 3 deletions 002. korea_cumulative_data_crwler/002_질본_현황크롤링.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
}
],
"source": [
"import requests\n",
"from bs4 import BeautifulSoup\n",
"from urllib.request import urlopen\n",
"import urllib.request\n",
Expand Down Expand Up @@ -83,10 +84,48 @@
"tot.append(num)\n",
"tot = pd.DataFrame(tot)\n",
"\n",
"tot.rename(columns={tot.columns[0] : status[0],\n",
"tot1 = tot.rename(columns={tot.columns[0] : status[0],\n",
" tot.columns[1] : status[1],\n",
" tot.columns[2] : status[2],\n",
" tot.columns[3] : status[3]})"
" tot.columns[3] : status[3]})\n",
"\n",
"tot1"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# 크롤링 시간\n",
"url = 'http://ncov.mohw.go.kr/'\n",
"\n",
"response = requests.get(url)\n",
"soups = BeautifulSoup(response.content, 'html.parser')\n",
"\n",
"update_time = soups.find(\"span\", class_=\"livedate\").text"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"업데이트 시간 : (3.18. 00시 기준, 1.3 이후 누계)\n",
" 확진환자 격리해제 격리중 사망\n",
"0 8,413 1,540 6,789 84\n"
]
}
],
"source": [
"# 출력\n",
"print(\"업데이트 시간 : \",update_time)\n",
"print(tot1)"
]
}
],
Expand All @@ -106,7 +145,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.7.1"
}
},
"nbformat": 4,
Expand Down
61 changes: 61 additions & 0 deletions 002. korea_cumulative_data_crwler/수기자료 완치자추가.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// ["1/20",1, 1, 0,0],
// ["1/21",1, 0, 0,0],
// ["1/22",1, 0, 0, 0],
// ["1/23",1, 0, 0, 0],
// ["1/24",2, 1, 0, 0],
// ["1/25",2, 0, 0, 0],
// ["1/26",3, 1, 0, 0],
// ["1/27",4, 1, 0, 0],
// ["1/28",4, 0, 0, 0],
// ["1/29",4, 0, 0, 0],
// ["1/30",6, 2, 0, 0],
// ["1/31",11, 5, 0, 0],
["2/1", 12, 1, 0, 0],
["2/2", 15, 3, 0, 0],
["2/3", 15, 0, 0, 0],
["2/4", 16, 1, 0,0],
["2/5", 19, 3, 0,0],
["2/6", 23, 4, 0,1],
["2/7", 24, 1, 0,1],
["2/8", 24, 0, 0,2],
["2/9", 27, 3, 0,3],
["2/10", 27, 0, 0,3],
["2/11", 28, 1, 0,4],
["2/12", 28, 0, 0,4],
["2/13", 28, 0, 0,7],
["2/14", 28, 0, 0,7],
["2/15", 28, 0, 0,9],
["2/16", 29, 1, 0,9],
["2/17", 30, 1, 0,9],
["2/18", 31, 1, 0,10],
["2/19", 51, 20, 0,12],
["2/20", 104, 53, 1,16],
["2/21", 204, 100, 2,16],
["2/22", 433, 229, 2,17],
["2/23", 602, 169, 6,18],
["2/24", 833, 231, 8,18],
["2/25", 977, 144, 12,22],
["2/26", 1261, 284, 13,22],
["2/27", 1766, 505, 13,24],
["2/28", 2337, 571, 16,26],
["2/29", 3150, 813, 17,27],
["3/1", 3736, 586, 21,30],
["3/2", 4212, 476, 22,30],
["3/3", 4812, 600, 28,34],
["3/4", 5328, 516, 32,41],
["3/5", 5766, 438, 35,88],
["3/6", 6284, 518, 42,108],
["3/7", 6767, 483, 44,118],
["3/8", 7134, 367, 50,130],
["3/9", 7382, 284, 51,166],
["3/10", 7513, 131, 54,247],
["3/11", 7755, 242, 60,288],
["3/12", 7869, 114, 66,333],
["3/13", 7979, 110, 67,410],
["3/14", 8086, 107, 72,714],
["3/15", 8162, 76, 75,834],
["3/16", 8236, 74, 75,1137],
["3/17", 8320, 158, 81,1401],
["3/18", 8413, 93, 84,1540],
["3/19", 8565, 152, 91,1947]
];
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
3/4 5328 (-293)
3/3 4812 (-374)
3/2 4212 (-123)
2/27 1595 (-171)
2/25 893 (-84)
2/27 1766
2/25 977
2/19 51 (+20)
Loading

0 comments on commit d5a434f

Please sign in to comment.