Spectroscopy is a very straight-forward and mature technique. Saying that “we see these spectral lines in this picture so there must be oxygen” is not considered any more controversial than “we see a bright dot in this picture so there must be a star”.