This commit is contained in:
dsyoon
2022-08-05 00:06:16 +09:00
parent 210537415b
commit a561c8dfd5
2 changed files with 3 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ stockFileName = PROJECT_HOME + '/resources/stock.db'
week = datetime.today().weekday() week = datetime.today().weekday()
if week in (0, 1, 2, 3, 4): if week in (0, 1, 2, 3, 4):
# 재무제표는 3개월마다 다운로드를 한다. # 재무제표는 3개월마다 다운로드를 한다.
fnGuideCrawler = FnGuideCrawler(START_DATE) fnGuideCrawler = FnGuideCrawler(START_DATE)
print("[KOSPI 상장기업 재무제표 다운로드]") print("[KOSPI 상장기업 재무제표 다운로드]")

View File

@@ -338,7 +338,7 @@ class StockCrawler:
continue continue
stock_data.append({ stock_data.append({
'CODE':item_code, 'NAME':us_stocks[item_code], 'ymd': ymd.strftime('%Y.%m.%d'), 'CODE':item_code, 'NAME':special_stocks[item_code], 'ymd': ymd.strftime('%Y.%m.%d'),
'close': round(stock['close'][ymd], 2), 'diff': round(diff, 2), 'open': round(stock['open'][ymd], 2), 'close': round(stock['close'][ymd], 2), 'diff': round(diff, 2), 'open': round(stock['open'][ymd], 2),
'high': round(stock['high'][ymd], 2), 'low': round(stock['low'][ymd], 2), 'volume': stock['volume'][ymd] 'high': round(stock['high'][ymd], 2), 'low': round(stock['low'][ymd], 2), 'volume': stock['volume'][ymd]
}) })
@@ -358,7 +358,7 @@ class StockCrawler:
conn.commit() conn.commit()
cursor.close() cursor.close()
conn.close() conn.close()
print(idx, item_code, us_stocks[item_code], (time.time() - start_time), "s") print(idx, item_code, special_stocks[item_code], (time.time() - start_time), "s")
start_time = time.time() start_time = time.time()
sleep(0.05) sleep(0.05)