This commit is contained in:
dosangyoon
2022-04-02 20:53:11 +09:00
parent 7620c32fbf
commit 5e43d8315e
2 changed files with 9 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ START_DATE = "1900.01.01"
start = time.time()
stockFileName = PROJECT_HOME + '/resources/stock.db'
# 재무제표는 3개월마다 다운로드를 한다.
fnGuideCrawler = FnGuideCrawler(START_DATE)
print("[KOSPI 상장기업 재무제표 다운로드]")

View File

@@ -275,9 +275,15 @@ class StockCrawler:
stock = usa_stock[item_code]
for i, ymd in enumerate(dateList):
if i > 0:
if ymd in stock['close'] and dateList[i-1] in stock['close']:
diff = stock['close'][ymd] - stock['close'][dateList[i-1]]
else:
continue
else:
if ymd in stock['close']:
diff = stock['close'][ymd]
else:
continue
stock_data.append({
'CODE':item_code, 'NAME':item_name[item_code], 'ymd': ymd.strftime('%Y.%m.%d'),