This commit is contained in:
dsyoon
2023-09-02 18:17:51 +09:00
parent bed0f6a4e8
commit b36d2c30f1
2 changed files with 62 additions and 124 deletions

View File

@@ -37,7 +37,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
slackBot.sendMsg("1. start to crawl...")
ERROR_COUNT = 0
while ERROR_COUNT < 3:
try:
@@ -133,53 +133,23 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
print("\n[종목 다운로드]")
stockCrawler = StockCrawler(START_DATE)
ERROR_COUNT = 0
while ERROR_COUNT < 3:
try:
print("\n[국내 ETF 수집]")
stockCrawler.crawl_etf_stocks(stockFileName)
slackBot.sendMsg("7. done etf stocks...")
break
except:
ERROR_COUNT += 1
continue
if ERROR_COUNT >= 3:
exit()
print("\n[국내 ETF 수집]")
stockCrawler.crawl_etf_stocks(stockFileName)
slackBot.sendMsg("7. done etf stocks...")
ERROR_COUNT = 0
while ERROR_COUNT < 3:
try:
print("\n[국내 종목 수집]")
stockCrawler.crawl_stocks(stockFileName)
slackBot.sendMsg("8. done stocks...")
break
except:
ERROR_COUNT += 1
continue
if ERROR_COUNT >= 3:
exit()
print("\n[국내 종목 수집]")
stockCrawler.crawl_stocks(stockFileName)
slackBot.sendMsg("8. done stocks...")
ERROR_COUNT = 0
while ERROR_COUNT < 3:
try:
print("\n[US 종목 수집]")
stockCrawler.crawl_special_stocks(stockFileName)
slackBot.sendMsg("9. done US stocks...")
break
except:
ERROR_COUNT += 1
continue
if ERROR_COUNT >= 3:
exit()
print("\n[US 종목 수집]")
stockCrawler.crawl_special_stocks(stockFileName)
slackBot.sendMsg("9. done US stocks...")