文件名称:新浪实时数据读取
文件大小:15KB
文件格式:DOCX
更新时间:2021-07-26 15:47:24
数据读取
新浪财经期货数据读取python. import requests import sys future_code = 'M1809' url_str = ('http://stock2.finance.sina.com.cn/futures/api/json.php/IndexService.getInnerFuturesDailyKLine?symbol=' + future_code) r = requests.get(url_str) r_json = r.json() r_lists = list(r_json) print('future_code,date,open,high,low,close,vol') for r_list in r_lists: for v in r_list: print(v + ',',end='') print('\n')