免費論壇 繁體 | 簡體
Sclub交友聊天~加入聊天室當版主
分享
返回列表 發帖
小弟是使用 Python 去抓,快速又便利:
基本只需要5行,範例如下:

import yfinance as yf
stock_list =['PSO', 'SPG', 'BEN', 'AHEXY', 'BAYRY'  ]
for symbol in stock_list:
    stock = yf.Ticker(symbol)
    print(f"{symbol}  Sector:{stock.info['sector']},  Industry:{stock.info['industry']}")

以下為輸出結果:
PSO  Sector:Communication Services,  Industryublishing
SPG  Sector:Real Estate,  Industry:REIT—Retail
BEN  Sector:Financial Services,  Industry:Asset Management
AHEXY  Sector:Industrials,  Industry:Staffing & Employment Services
BAYRY  Sector:Healthcare,  Industryrug Manufacturers—General

GOOGLE 的 COLAB 有提供免費環境可以執行

TOP

返回列表