Multiphoton ionization: mass selective laser-spectroscopy of Na2 and K2 in molecular beams