Absorption spectra and oscillator strength ratio measurements for Δn = 1 transitions from excited levels of Be I and Be II