How can I select faces by color with Python?
You don't need python here. Go to edit mode select a face with your desired color, press SHIFTG and choose Material.

Alternatively you can also choose a material in the properties editor and hit select below, to select all faces assigned to that material.