양선아

mid report

......@@ -5,11 +5,10 @@ from urllib.request import urlopen
import pandas as pd
import requests
import os
import datetime
url = 'http://211.237.50.150:7080/openapi/5e5e94876b673efe7161d3240516d65476da16210a391a9d6f31224c54a1fdaf/xml/Grid_20141119000000000012_1/'
number = 0
def makecsvfile(day):
# file name setting
......@@ -56,7 +55,7 @@ def makecsvfile(day):
# 결과 확인을 위한 print
print(str(day), ' : ', str(i))
# csv 파일로 내보내기
df.to_csv(os.path.join('./', output_file), encoding='euc-kr', index=False)
df.to_csv(os.path.join('./auctiondata', output_file), encoding='euc-kr', index=False)
def checkdatanum(day):
myurl = url +'1/1?AUCNG_DE='+str(day)
......@@ -69,10 +68,20 @@ def checkdatanum(day):
print(day,':',product_num)
return product_num
i = 0
last_day = datetime.date(2020,4,12)
first_day = datetime.date(2020,1,1) - datetime.timedelta(days=1)
days=[20200413, 20200414, 20200415, 20200416, 20200417, 20200418, 20200412]
while(first_day < last_day):
first_day += datetime.timedelta(days=1)
makecsvfile(first_day.strftime('%Y%m%d'))
'''
for day in days:
number += checkdatanum(day)
print('week : ', number)
makecsvfile(day)
#number += checkdatanum(day)
#print('week : ', number)
'''
\ No newline at end of file
......
No preview for this file type
No preview for this file type