josw123 / dart-fss

한국 금융감독원에서 운영하는 다트(Dart) 시스템 크롤링을 위한 라이브러리
https://github.com/josw123/dart-fss
MIT License
319 stars 111 forks source link

손익계산서 가져오지 못해서 문의합니다. #150

Closed WonSeokChoi-Unicorn closed 8 months ago

WonSeokChoi-Unicorn commented 8 months ago

이래 저래 해도 도저히 답이 나오지 않아서 이렇게 글을 작성합니다.

corpinfo = corplist.find_by_stock_code('095570')

try:

65행: fs = corpinfo.extract_fs(bgn_de = '20230101', fs_tp = 'is', report_tp = ['annual', 'half', 'quarter'], last_report_only = False) except NotFoundConsolidated: print(datetime.today().strftime('%Y-%m-%d %H:%M:%S') + ", 연결재무제표가 없으므로 개별재무제표를 추출합니다.") 68행: fs = corpinfo.extract_fs(bgn_de = '20230101', fs_tp = 'is', report_tp = ['annual', 'half', 'quarter'], last_report_only = False, separate = True)

이렇게 하면

("'NoneType' object is not iterable", "An error occurred while fetching or analyzing {'rcp_no': '20230515002500', 'corp_code': '00365387', 'corp_name': 'AJ네트웍스', 'stock_code': '095570', 'corp_cls': 'Y', 'report_nm': '분기보고서 (2023.03)', 'flr_nm': 'AJ네트웍스', 'rcept_dt': '20230515', 'rm': ''}.")

line 65, in fs = corpinfo.extract_fs(bgn_de = '20230101', fs_tp = 'is', report_tp = ['annual', 'half', 'quarter'], last_report_only = False) dart_fss.errors.errors.NotFoundConsolidated: ('Could not find consolidated financial statements', "An error occurred while fetching or analyzing {'rcp_no': '20230515002500', 'corp_code': '00365387', 'corp_name': 'AJ네트웍스', 'stock_code': '095570', 'corp_cls': 'Y', 'report_nm': '분기보고서 (2023.03)', 'flr_nm': 'AJ네트웍스', 'rcept_dt': '20230515', 'rm': ''}.")

During handling of the above exception, another exception occurred:

line 68, in fs = corpinfo.extract_fs(bgn_de = '20230101', fs_tp = 'is', report_tp = ['annual', 'half', 'quarter'], last_report_only = False, separate = True) TypeError: ("'NoneType' object is not iterable", "An error occurred while fetching or analyzing {'rcp_no': '20230515002500', 'corp_code': '00365387', 'corp_name': 'AJ네트웍스', 'stock_code': '095570', 'corp_cls': 'Y', 'report_nm': '분기보고서 (2023.03)', 'flr_nm': 'AJ네트웍스', 'rcept_dt': '20230515', 'rm': ''}.")

라는 메세지가 나옵니다.

dart-fss는 0.4.7 버전을 사용하고 있습니다.

제가 무엇을 잘 못해서 오류가 발생할까요?

josw123 commented 8 months ago

안녕하세요.

올려주신 코드를 보내 fs_tp 설정이 잘못되어서 그렀습니다. fs_tp는 tuple 혹은 list 형태로 전달해야 되므로 위의 코드와 같이 사용하시는 경우 fs_tp=['is'] 또는 fs_tp=('is',) 형태로 전달해야 됩니다.

그러므로 아래와 같이 작성하시면 올바르게 동작하는 것을 확인하실 수 있습니다.

fs = corpinfo.extract_fs(bgn_de = '20230101', separate=True, fs_tp = ('is',), report_tp = ['annual', 'half', 'quarter'], last_report_only = False)
WonSeokChoi-Unicorn commented 8 months ago

['is']

설명 잘 해주셔서 감사합니다.