How were molecular formulas determined before spectroscopy and spectronomy? I know that John Dalton thought that the formula of water was "HO" but we now know it to be "H2O." How did Dalton even know that water had hydrogen and oxygen in the first place?
Lavoisier burned hydrogen and oxygen together and found that water was produced. Dalton incorporated this information into his thinking that the most stable arrangement of any two atoms involved a 1:1 combination, therefore water would be "OH".
In slightly more recent times, but prior to modern-day spectroscopy, chemists would chemically chop molecules into identifiable fragments. They would also combust the molecule and get a C,H,N,O ratio. Putting all of this together they would (often) come up with remarkably accurate molecular formulas.