You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import os
from urllib.request import urlopen
from io import BytesIO
import zipfile
from pandas import DataFrame as pd
import dart_fss as dart
from datetime import datetime, timedelta
import re
import OpenDartReader
import requests
import json
import urllib
try:
from pandas import json_normalize
except ImportError:
from pandas.io.json import json_normalize
#날짜, 시간에 대한 변수
now = datetime.now()#2022-09-21 11:35:02
before_one_week = now - timedelta(weeks=1)#2022-09-14 11:35:02
bedate=re.sub(r'[^0-9]', '', str(before_one_week))#20220914113502
bedate=bedate[:8]#20220914
import os
from urllib.request import urlopen
from io import BytesIO
import zipfile
from pandas import DataFrame as pd
import dart_fss as dart
from datetime import datetime, timedelta
import re
import OpenDartReader
import requests
import json
import urllib
try:
from pandas import json_normalize
except ImportError:
from pandas.io.json import json_normalize
#날짜, 시간에 대한 변수
now = datetime.now()#2022-09-21 11:35:02
before_one_week = now - timedelta(weeks=1)#2022-09-14 11:35:02
bedate=re.sub(r'[^0-9]', '', str(before_one_week))#20220914113502
bedate=bedate[:8]#20220914
api_key=''
dart.set_api_key(api_key=api_key)
url="https://opendart.fss.or.kr/api/list.json?crtfc_key="+api_key+"&bgn_de="+bedate+"&corp_cls=Y"
RLT=urllib.request.urlopen(url)#url에서의 요청 내용 불러오기
D=RLT.read().decode("utf-8")#uft-8==인코딩
#D는 정보를 가지고 있는 url을 읽은 dept 파일
D1=json.loads(D)
recept_no=D1['list'][0]['rcept_no']#고유번호
#공시서류원본파일 url
DNurl="https://opendart.fss.or.kr/api/document.xml?crtfc_key=(K)&rcept_no=recep_no)".foramt(K=api_key,recept_no=recept_no)
urllib.request.urlretrieve(DNurl,"dart_downloadfile.zip")
#zipfile 다운로드
with zipfile.ZipFile("dart_downloadfile.zip","r") as zip_ref:
zip_ref.extractall()
#zip파일 풀기
The text was updated successfully, but these errors were encountered: