The Integrated Taxonomic Information System (ITIS) is maintained regularly by a consortium of North American governmental agencies, and will give you a list of all the classes, orders, families or genera in any of seven kingdoms they recognize. It might be biased towards North American taxa, but it might be quicker to get a list from then rather than extracting them from Wikipedia.
To help you further, user Rozenn Keribin used a sed script to summarize the number of families per phylum at https://justpaste.it/163c6.