For many years the Yahoo historical data for funds included capital gains in the "dividend" historical data. Some time in the last three months, only "dividend-dividends" appear in the amounts. (Go look at a fund that pays sometimes-whopping CG but not income like RYPNX for proof.) So back to scraping prospectuses for the data.
For 30 years I've kept a database of weekly quote data for 50 or so funds, etfs, and indices, including distriubution data. So goes the last vestige of usefulness for Yahoo Finance for this, unless you like spam from crypto pump and dump schemes. I switched to Tiingo for my weekly quote update long ago when Yahoo dumped their finance API, and I recommend it. It's free for modest use; they seem to make money by charging for more advanced and real time data.