In this work we consider the theoretical treatment of the interaction of a laser pulse with an atom and focus on the methodology used to extract the quantity that is observed experimentally, i.e., the electron probability density. We solve the time-dependent Schrödinger equation (TDSE) using two techniques: the spectral method, which makes use of an expansion of the wave function onto the field-free atomic eigenstates, and the wave-function method, where the TDSE is numerically solved on a grid. In this work we show that the electron probability density can be extracted from the final wave function, obtained by the wave-function method, by using the resolvent technique with a proper choice of the energy resolution. The advantage of this approach is that it does not require the calculation of the field-free atomic eigenstates. As an illustration of this method we compare the spectral and wave-function methods in the case of atomic hydrogen interacting with a linearly polarized mid-IR laser pulse. The comparison shows excellent agreement.