Comments (1)
遇到任何问题,请先确认您的 AKShare 版本是最新的
pip install akshare --upgrade # Python 版本需要大于等于 3.8
描述遇到的问题 操作系统版本 win11 Python 版本 3.10.11 AKShare 版本 1.13.38 接口的名称和代码 fund_etf_hist_min_em 接口报错的截图或代码 左边为昨天获取到159509.SZ的数据,右边是今天获取到159509.SZ的数据,昨天可以获取到23号为什么今天不行
import akshare as ak import time import os path = "ETF数据" # 目标目录的名称 start_time = '20240101 09:30:00' # 开始时间 end_time = '20240415 15:00:00' # 结束时间 if not os.path.exists(path): # 判断目标目录是否存在 print("-----------------------无”{}“目录".format(path)) os.makedirs(path) # 创建目标目录 print("-----------------------已创建”{}“目录至该程序同目录下".format(path)) def download_data(symbol): print(symbol) code = symbol[:6] df = ak.fund_etf_hist_min_em(symbol=code, period="5", adjust="", start_date='{}'.format(start_time), end_date='{}'.format(end_time)) print(df) df.to_csv('{}\\{}.csv'.format(path, symbol), encoding='gbk') print("{}-{}数据-{}已保存至“{}”目录下".format(start_time, end_time, symbol, path)) time.sleep(2) if __name__ == '__main__': # ETF池列表 symbols = [ '159501.SZ', '159502.SZ', '159506.SZ', '159509.SZ', '159513.SZ', '159518.SZ', '159519.SZ', '159529.SZ', '159567.SZ', '159568.SZ', '159570.SZ', '159577.SZ', '159605.SZ', '159607.SZ', '159612.SZ', '159615.SZ', '159632.SZ', '159636.SZ', '159655.SZ', '159659.SZ', '159660.SZ', '159687.SZ', '159688.SZ', '159691.SZ', '159696.SZ', '159699.SZ', '159711.SZ', '159712.SZ', '159718.SZ', '159726.SZ', '159735.SZ', '159740.SZ', '159741.SZ', '159742.SZ', '159747.SZ', '159750.SZ', '159751.SZ', '159776.SZ', '159788.SZ', '159792.SZ', '159822.SZ', '159823.SZ', '159850.SZ', '159866.SZ', '159892.SZ', '159920.SZ', '159941.SZ', '159954.SZ', '159960.SZ', '510900.SH', '513000.SH', '513010.SH', '513020.SH', '513030.SH', '513040.SH', '513050.SH', '513060.SH', '513070.SH', '513080.SH', '513090.SH', '513100.SH', '513110.SH', '513120.SH', '513130.SH', '513140.SH', '513150.SH', '513160.SH', '513180.SH', '513190.SH', '513200.SH', '513220.SH', '513230.SH', '513260.SH', '513280.SH', '513290.SH', '513300.SH', '513310.SH', '513320.SH', '513330.SH', '513350.SH', '513360.SH', '513380.SH', '513390.SH', '513400.SH', '513500.SH', '513520.SH', '513530.SH', '513550.SH', '513560.SH', '513580.SH', '513590.SH', '513600.SH', '513630.SH', '513650.SH', '513660.SH', '513690.SH', '513700.SH', '513730.SH', '513750.SH', '513770.SH', '513800.SH', '513810.SH', '513850.SH', '513860.SH', '513870.SH', '513880.SH', '513890.SH', '513900.SH', '513910.SH', '513920.SH', '513950.SH', '513960.SH', '513970.SH', '513980.SH', '513990.SH' ] # ETF池列表 for symbol in symbols: download_data(symbol)
- 期望获得的正确结果
正常获取数据
接口正常,只能获取近【期】的数据
from akshare.
Related Issues (20)
- 调用ak.sw_index_first_info()的错误 HOT 2
- 20240511获取上期所每日行情数据获取不到 HOT 1
- stock_board_concept_cons_ths接口建议 HOT 2
- 期货函数get_futures_daily报错
- 文档可以下载吗?
- 有没有“社会融资规模存量”?
- `migration_area_baidu` excludes area from param `area` HOT 4
- stock_fhps_detail_ths warning HOT 1
- 期货上期所获取期货合约信息函数报错futures_contract_info_shfe HOT 4
- 个股新闻查询-AKShare 接口问题报告 HOT 1
- 上期所数据获取问题及其解决 HOT 5
- AKShare 沪深股通数据接口 stock_hsgt_hist_em 返回数据异常 HOT 1
- 上期所获取合约信息函数报错,更改网址仍然失效 ak.futures_contract_info_shfe(date=day) HOT 2
- 需求:华尔街见闻的宏观日历 HOT 2
- AKShare 接口问题报告 HOT 3
- 接口问题报告:同花顺行业板块实时信息接口 数据延迟 HOT 2
- stock_zh_index_daily 不支持多周期(日,分钟级别K线) HOT 1
- AKShare 接口问题报告 HOT 1
- stock_zh_a_hist_min_em的1分钟返回数据的open为0 HOT 1
- AKShare 接口问题报告ak.stock_news_em() HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from akshare.