The electronic absorption spectra of pyridine and nicotine in aqueous solution have been computed using a multistep approach. The computational protocol consists in studying the solute solvation with accurate molecular dynamics simulations, characterizing the hydrogen bond interactions, and calculating electronic transitions for a series of configurations extracted from the molecular dynamics trajectories with a polarizable QM/MM scheme based on the fluctuating charge model. Molecular dynamics simulations and electronic transition calculations have been performed on both pyridine and nicotine. Furthermore, the contributions of solute vibrational effect on electronic absorption spectra have been taken into account in the so called vertical gradient approximation.