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...")