获取所有EFT基金实时行情数据,打印完整数据,并保存到csv文件
代码:
import pandas as pd
import akshare as ak
# 列名与数据对其显示
pd.set_option('display.unicode.ambiguous_as_wide', True)
pd.set_option('display.unicode.east_asian_width', True)
# 显示所有列
pd.set_option('display.max_columns', None)
# 显示所有行
pd.set_option('display.max_rows', None)
etf = ak.fund_etf_category_sina(symbol="ETF基金")
etf.to_csv("sina_etf_list.csv", encoding='utf-8-sig')
print(etf)
输出:
,代码,名称,最新价,涨跌额,涨跌幅,买入,卖出,昨收,今开,最高,最低,成交量,成交额
0,sz159998,计算机ETF,0.783,-0.007,-0.886,0.783,0.784,0.79,0.79,0.795,0.783,50959700,40169136
1,sz159997,电子ETF,0.898,-0.006,-0.664,0.897,0.898,0.904,0.902,0.909,0.896,55733800,50339842
2,sz159996,家电ETF,1.126,-0.009,-0.793,1.125,1.126,1.135,1.132,1.134,1.125,62686000,70809178
3,sz159995,芯片ETF,0.9,-0.013,-1.424,0.9,0.901,0.913,0.911,0.916,0.9,378594070,343609222
4,sz159994,5GETF,0.811,0.003,0.371,0.81,0.811,0.808,0.806,0.821,0.8,59203211,48026676
5,sz159993,证券ETF龙头,0.946,-0.014,-1.458,0.945,0.946,0.96,0.96,0.961,0.945,40697200,38736980
6,sz159992,创新药ETF,0.738,-0.017,-2.252,0.738,0.739,0.755,0.749,0.749,0.738,363454900,270301809
7,sz159991,创大盘ETF,0.398,-0.004,-0.995,0.397,0.398,0.402,0.402,0.402,0.397,3858719,1539168
8,sz159990,小盘价值ETF,1.221,-0.012,-0.973,1.218,1.221,1.233,1.228,1.234,1.218,2687200,3287412
9,sz159987,科技创新ETF,1.215,-0.007,-0.573,1.215,1.216,1.222,1.221,1.223,1.215,167500,203888
10,sz159985,豆粕ETF,2.168,0.02,0.931,2.168,2.169,2.148,2.154,2.17,2.151,146928200,317451516
11,sz159982,中证500ETF鹏华,1.342,-0.014,-1.032,1.342,1.343,1.356,1.35,1.354,1.342,10402300,14023352
12,sz159981,能源化工ETF,1.638,0.009,0.552,1.638,1.639,1.629,1.638,1.648,1.634,22008600,36128843
13,sz159980,有色ETF,1.599,-0.007,-0.436,1.598,1.599,1.606,1.611,1.613,1.592,49128900,78813682
14,sz159977,创业板ETF天弘,1.945,-0.02,-1.018,1.945,1.946,1.965,1.962,1.963,1.945,20401800,39880173
15,sz159976,湾创ETF,0.901,-0.008,-0.88,0.9,0.902,0.909,0.906,0.907,0.901,186200,168090
16,sz159975,深100ETF招商,0.513,-0.001,-0.195,0.512,0.514,0.514,0.514,0.517,0.513,12313300,6342823
17,sz159974,央企创新ETF,1.47,-0.013,-0.877,1.466,1.47,1.483,1.482,1.484,1.47,3384900,4998917
18,sz159973,民企ETF,1.165,-0.009,-0.767,1.156,1.177,1.174,1.169,1.176,1.165,1876200,2201256
19,sz159972,5年地债ETF,113.688,0.026,0.023,113.662,113.689,113.662,113.69,113.728,113.602,624700,70990335
20,sz159971,创业板ETF富国,1.3,-0.01,-0.763,1.298,1.3,1.31,1.31,1.31,1.299,4790700,6233198
21,sz159970,深100ETF工银,4.3,-0.014,-0.325,4.257,4.333,4.314,4.302,4.327,4.3,351844,1517406
22,sz159969,深100ETF银华,1.078,-0.005,-0.462,1.069,1.08,1.083,1.08,1.086,1.078,925234,999690
23,sz159968,中证500ETF博时,6.548,-0.068,-1.028,6.557,6.564,6.616,6.611,6.611,6.544,1535109,10107185
24,sz159967,创业板成长ETF,0.436,-0.005,-1.134,0.436,0.437,0.441,0.439,0.441,0.436,240743302,105605833
25,sz159966,创业板价值ETF,0.426,0.0,0.0,0.425,0.426,0.426,0.425,0.429,0.424,5069971,2165362
26,sz159965,央视50ETF,1.288,-0.007,-0.541,1.288,1.29,1.295,1.292,1.302,1.288,1313700,1698193
27,sz159964,创业板ETF平安,1.206,-0.012,-0.985,1.206,1.207,1.218,1.212,1.217,1.205,4256700,5158522
28,sz159961,深100ETF方正富邦,1.502,-0.006,-0.398,1.502,1.508,1.508,1.504,1.514,1.502,2511100,3787506
29,sz159960,恒生中国企业ETF,0.643,-0.009,-1.38,0.642,0.643,0.652,0.653,0.653,0.642,8444100,5448795
30,sz159959,央企ETF,1.333,-0.012,-0.892,1.332,1.333,1.345,1.342,1.344,1.332,9779200,13087280
31,sz159958,创业板ETF工银,1.115,-0.012,-1.065,1.115,1.118,1.127,1.127,1.127,1.111,3411800,3823781
32,sz159957,创业板100ETF华夏,1.222,-0.011,-0.892,1.222,1.223,1.233,1.232,1.232,1.222,1584700,1947207
33,sz159956,创业板ETF建信,1.213,0.018,1.506,1.213,1.22,1.195,1.188,1.213,1.169,1079500,1268667
34,sz159954,H股ETF,0.622,-0.008,-1.27,0.621,0.622,0.63,0.629,0.629,0.62,21931200,13665372
35,sz159952,创业板ETF广发,1.127,-0.012,-1.054,1.127,1.128,1.139,1.138,1.139,1.127,109258500,123854044
36,sz159949,创业板50ETF,0.811,-0.011,-1.338,0.81,0.811,0.822,0.818,0.82,0.81,625981705,510310125
37,sz159948,创业板ETF南方,2.054,-0.016,-0.773,2.053,2.054,2.07,2.071,2.071,2.051,4929300,10171515
38,sz159945,能源ETF基金,1.16,0.006,0.52,1.158,1.16,1.154,1.153,1.174,1.153,7729900,8997833
39,sz159944,材料ETF,0.917,-0.002,-0.218,0.917,0.918,0.919,0.914,0.928,0.914,1104100,1016653
40,sz159943,深证成指ETF,1.006,-0.008,-0.789,1.005,1.006,1.014,1.011,1.015,1.005,6563290,6633083
41,sz159941,纳指ETF,0.985,-0.006,-0.605,0.985,0.986,0.991,0.988,0.989,0.985,480944700,474657800
42,sz159940,金融地产ETF,0.9,-0.012,-1.316,0.9,0.901,0.912,0.915,0.915,0.897,13907700,12542496
43,sz159939,信息技术ETF,0.513,-0.002,-0.388,0.512,0.513,0.515,0.515,0.519,0.512,46966700,24215766
标签:0.9,EFT,实时,获取,1.127,ETF,etf,0.012,100ETF
From: https://blog.csdn.net/lildkdkdkjf/article/details/136843964