This commit is contained in:
dsyoon
2023-07-11 12:34:18 +09:00
parent 21dd79331a
commit d2edee26b4
2 changed files with 38 additions and 14 deletions

View File

@@ -36,6 +36,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:
@@ -51,6 +52,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
exit()
metaCrawler = MetaCrawler(START_DATE)
ERROR_COUNT = 0
while ERROR_COUNT < 3:
try:
@@ -76,7 +78,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
continue
if ERROR_COUNT >= 3:
exit()
ERROR_COUNT = 0
while ERROR_COUNT < 3:
try:
@@ -90,10 +92,11 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
if ERROR_COUNT >= 3:
exit()
ERROR_COUNT = 0
while ERROR_COUNT < 3:
try:
print("\n[환율 (USD, JPY, EUR, CNY)]")
print("\n[환율 (USD, JPY, EUR, CNY, HKD, GBP, CAD, CHF, AUD, THB, INR, PHP, BRL, VND, RUB, TWD')]")
metaCrawler.crawl_exchange(stockFileName)
slackBot.sendMsg("5. done exchange data...")
break
@@ -106,7 +109,7 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
ERROR_COUNT = 0
while ERROR_COUNT < 3:
try:
print("\n[원유 (WTI), 국제금, COPPER, NATURALGAS, CORN, SOYBEAN]")
print("\n[원유 (WTI), 국제금, COPPER, NATURALGAS, CORN, SOYBEAN]")
metaCrawler.crawl_meterials(stockFileName)
slackBot.sendMsg("6. done additional data...")
break
@@ -204,5 +207,6 @@ 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...")