On Android at least, you can go to Settings > Network and Internet > Internet > Saved networks to see a list of all Wi-Fi networks you've connected to. I don't know if Wi-Fi passwords get backed up anywhere, so just in case, this allows you to somewhat easily (though still painstakingly) export each Wi-Fi network's password.
The networks are saved locally, so you won't lose them if you accidentally close the browser. Once you're done, click the "Download as CSV" button and be happy.