장수창

status to txt file

......@@ -3,7 +3,7 @@ from bs4 import BeautifulSoup
from datetime import datetime
day_month = datetime.today().month
day_day = datetime.today().day
day_day = datetime.today().day
data = []
url='https://search.naver.com/search.naver?sm=top_hty&fbm=1&ie=utf8&query=%EC%BD%94%EB%A1%9C%EB%82%98+%ED%98%84%ED%99%A9'
......@@ -19,7 +19,11 @@ datasets = datasets[1:]
datasets = datasets[:-1]
for i in range(0,4):
datasets[i] = datasets[i].replace(" ","")
datasets.append(day_month)
datasets.append(day_day)
print(datasets)
\ No newline at end of file
# insert into text file
date = f"{day_month}월 {day_day}일"
f = open("status.txt", 'w')
f.write(date + "\n")
for i in datasets:
f.write(i + "\n")
f.close()
\ No newline at end of file
......
6월 17일
확진환자12,155
격리해제10,760
검사진행22,632
사망자278