The [Integrated Taxonomic Information System][1] (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][2] 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](https://biology.stackexchange.com/users/30356/rozenn-keribin) used a sed script to summarize the number of families per phylum at https://justpaste.it/163c6.

  [1]: https://www.itis.gov/
  [2]: https://www.itis.gov/hierarchy.html