Headlights go on and off when engine is hot

Could be the switch, the wires or the dimmer switch on the floor.
These old girls didn't have headlight relays.

Might want to turn them on just sitting and do a wiggle test on everything before buying anything besides the dash switch.