Characterizing quasibound states from coupled-channel scattering calculations can be a laborious task, involving extensive manual iteration and fitting. We present an automated procedure, based on the phase shift or S-matrix eigenphase sum, that reliably converges on a quasibound state (or scattering resonance) from some distance away. It may be used for both single-channel and multichannel scattering. It produces the energy and width of the state and the phase shift of the background scattering, and hence the lifetime of the state. It also allows extraction of partial widths for decay to individual open channels. We demonstrate the method on a very narrow state in the Van der Waals complex Ar--H$_2$, which decays only by vibrational predissociation, and on near-threshold states of $^{85}$Rb$_2$, whose lifetime varies over 4 orders of magnitude as a function of magnetic field.