Spectroscopic properties of molecules in solution: an effective computational approach based on non-periodic boundary conditions