Electron attachment to molecules and its use for molecular spectroscopy