From Sahih Muslim (Hadith 5821):
Safiyya reported from some of the wives of Allah's Apostle (ﷺ) Allah's Apostle (ﷺ) having said:He who visits a diviner ('Arraf) and asks him about anything, his prayers extending to forty nights will not be accepted
Reference: Muslim 5821