Dear Alicia Morcillo Mora, by drying, freeze-drying is more preferred than thermal drying, since in the later some chemical changes may occur, and some groups (or low MW fractions) may be lost during the drying process. So the method is simply weight a small mass sample and expose it to drying. Once a constant weight is reached, thus complete drying is achieved, and the mass of water is the mass difference of the sample before and after drying. My Regards
in fact if your hydrogel is in swelled form. it is better to follow Abdelkader's suggestion. however if you have a dry gel (polymeric structure) and want to measure water absorption, you could soak the gel in predetermined amount of deionized water and calculate the water level drop. finally you can reach to the number by water molar mass. good luck