Sayyiduna Sahl bin Hunayf (may Allah be pleased with him) said: I saw Sayyiduna Muhammad bin Maslamah al-Ansari (may Allah be pleased with him): he saw the daughter of al-Dahhak playing on a wall and began looking at her. It was said to him: Do you look at her when you are a Companion of the Messenger of Allah (peace and blessings be upon him)? He said: I heard the Messenger of Allah (peace and blessings be upon him) say: "When Allah puts into a person's heart (the thought of) proposing marriage to a woman, there is no harm in his looking at her."
Hammad bin Salamah narrated it thus, and in it he went against the other narrators. Those who narrate from al-Hajjaj bin Artah differ over this hadith, and in my view — and Allah knows best — the correct version is what Hafs bin Ghiyath and Yazid bin Harun narrated from al-Hajjaj, from Muhammad bin Sulayman bin Abi Hathmah, from his paternal uncle Sahl bin Abi Hathmah, from Muhammad bin Maslamah (may Allah be pleased with him).
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 16554