Those examples are from the 19th century, when, as you have noticed, people often said "Good morning", "Good afternoon" or "Good evening", both when they met and left someone in the morning, afternoon or evening respectively. I remember as a small child noticing that my grandmother, born in 1890, did this. However this is very old fashioned and would be considered odd nowadays. People would be more likely to say "goodbye", although there are many possible parting remarks that people use.
Nobody ever says or said "Good night" when they meeting someone at night, only when parting.