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 an awk script to summarize the number of families per phylum at https://justpaste.it/163c6.
Phylum: Myxozoa -- 4
Phylum: Chordata -- 1049
Phylum: Echinodermata -- 139
Phylum: Hemichordata -- 7
Phylum: Xenacoelomorpha -- 9
Phylum: Chaetognatha -- 9
Phylum: Arthropoda -- 2504
Phylum: Kinorhyncha -- 10
Phylum: Loricifera -- 2
Phylum: Nematoda -- 192
Phylum: Nematomorpha -- 3
Phylum: Onychophora -- 2
Phylum: Priapulida -- 3
Phylum: Tardigrada -- 20
Phylum: Annelida -- 142
Phylum: Brachiopoda -- 21
Phylum: Bryozoa -- 133
Phylum: Kamptozoa -- 5
Phylum: Mollusca -- 581
Phylum: Nemertea -- 20
Phylum: Phoronida -- 0
Phylum: Sipuncula -- 6
Phylum: Acanthocephala -- 26
Phylum: Gastrotricha -- 13
Phylum: Gnathostomulida -- 12
Phylum: Micrognathozoa -- 1
Phylum: Orthonectida -- 2
Phylum: Platyhelminthes -- 321
Phylum: Rhombozoa -- 3
Phylum: Rotifera -- 34
Phylum: Cnidaria -- 269
Phylum: Ctenophora -- 19
Phylum: Placozoa -- 0
Phylum: Porifera -- 142
Total -- 5703