# How were weights of elements and compounds determined? [duplicate]

I have browsed through many questions on this site but I still don't understand this:

How chemists in the past used to determine the weight of substances (which I believe they randomly called elements or compounds) without using modern techniques?

For example ... we know the molecular formula of water is $\ce{H2O}$

But how did chemists determine the composition of water?

How did they know hydrogen and oxygen, and not some other substance, made water and how could they determine the weight according to which combined?

What was the complete procedure behind it?

EDIT: Just like I said.... That answer still doesn't show us the complete picture... Moreover, the answerer has used phrases like (I don't know) and (Maybe) many times....