Riyad as-SalihinChapter 17Hadith 990
Full Sharh — Riyad as-Salihin 990
وعن قبيصة بنت أبي عبيد، عن بعض أزواج النبي صلى الله عليه وسلم، ورضي الله عنها، عن النبي صلى الله عليه وسلم قال: "من أتي عرافًا فسأله عن شيء، فصدقه، لم تقبل له صلاة أربعين يومًا" ((رواه مسلم)).
English Translation
Narrated Safiyyah, daughter of Abu 'Ubaid, on the authority of some of the wives of the Prophet (ﷺ) who said, "He who goes to one who claims to tell about matters of the Unseen and believes in him, his Salat (prayers) will not be accepted for forty days.".
Source
Riyad as-Salihin(رياض الصالحين)
The Book of the Prohibited actions
Hadith Number
990