We develop a nonperturbative approach for calculating the superconducting transition temperatures (Tc's) of liquids. The electron-electron scattering amplitude induced by electron-phonon coupling (EPC), from which an effective pairing interaction can be inferred, is related to the fluctuation of the T matrix of electron scattering induced by ions. By applying the relation, EPC parameters can be extracted from a path-integral molecular dynamics simulation. For determining Tc, the linearized Eliashberg equations are reestablished nonperturbatively. We apply the approach to estimate Tc's of metallic hydrogen liquids. It indicates that metallic hydrogen liquids in the pressure regime from 0.5 to 1.5 TPa have Tc's well above their melting temperatures and therefore are superconducting liquids.