diff --git a/HTS_Downloader.py b/HTS_Downloader.py index c8dbd2d..b33599b 100644 --- a/HTS_Downloader.py +++ b/HTS_Downloader.py @@ -1,4 +1,5 @@ import os +import time from datetime import datetime, timedelta from hts.HTS import HTS @@ -83,6 +84,6 @@ if __name__ == "__main__": this_day = this_day + timedelta(days=1) if this_day > stock["end_date"]: break - + time.sleep(0.5) hts.disconnect() print ("done...") diff --git a/hts/HTS.py b/hts/HTS.py index a10ed85..f5365e9 100644 --- a/hts/HTS.py +++ b/hts/HTS.py @@ -493,7 +493,6 @@ class HTS: self.cursor.execute('DELETE FROM hts WHERE CODE=? and ymd=? and hms=?', (stock_code, ymd, hms,)) self.cursor.execute("INSERT INTO hts (CODE, NAME, ymd, hms, close, open, high, low, volume) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)", (stock_code, stock_name, ymd, hms, close, open, high, low, volume)) - time.sleep(0.5) self.conn.commit() return