ak13/sz159745.py
cheney fcf9b977fb
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m42s
拆分 day 和 hour 逻辑
2025-07-22 15:32:00 +08:00

15 lines
461 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import akshare as ak
def fund():
# 获取建材ETF159745的最新行情
df = ak.fund_etf_hist_sina(symbol="sz159745")
latest_price = df.iloc[-1]["close"] # 最新收盘价
print(f"建材ETF159745最新报价{latest_price}")
def price():
df = ak.stock_individual_spot_xq(symbol="sz159745")
latest_price = df.query("item == '现价'")["value"].values[0]
return latest_price
if __name__ == '__main__':
price()