From 21dd79331ab01f068265d032c40f502f1e6f1d09 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Mon, 10 Jul 2023 22:39:39 +0900 Subject: [PATCH] init --- StockCrawler.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/StockCrawler.py b/StockCrawler.py index 310eddd..45a1e7e 100644 --- a/StockCrawler.py +++ b/StockCrawler.py @@ -188,7 +188,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일 dayList = os.listdir(outPath) for dayDir in dayList: if dayDir[0] != '.' and dayDir < before_7_day.strftime("%Y%m%d"): - if os.path.exists(os.path.join(outPath, dayDir)): + if os.path.exists(os.path.join(outPath, dayDir)) and os.path.isdir(os.path.join(outPath, dayDir)): shutil.rmtree(os.path.join(outPath, dayDir)) outPath = os.path.join(outPath, day) if os.path.isdir(outPath): @@ -204,6 +204,5 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일 if ERROR_COUNT >= 3: exit() - print("time : %6.2f 초", (time.time() - start)) print ("done...")