小弟是使用 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, Industry ublishing
SPG Sector:Real Estate, Industry:REIT—Retail
BEN Sector:Financial Services, Industry:Asset Management
AHEXY Sector:Industrials, Industry:Staffing & Employment Services
BAYRY Sector:Healthcare, Industry rug Manufacturers—General
GOOGLE 的 COLAB 有提供免費環境可以執行 |