I’m trying to get the top 5 most capitalised companies listed on SP500. The ideal would be to have a monthly/quartetly frequency.
I tried using yfinance but market cap data goes only back to 2023. I would like to list the top 5 companies since the inception of SP500 on every year (it would be ok also just from 1990).
I can’t find a way to do that. Also tried webscraping from wikipedia but there is only info about the change of costituents over time, no way to make the “top 5 ranking”.
Any suggestions?
2