(17) The Book of the Prohibited actions
كتاب الأمور المنهي عنها
(303) Chapter: Prohibition of Consultation with Soothsayers
(303) - باب النهي عن إتيان الكهان والمنجمين والعراف وأصحاب الرمل والطوارق بالحصى وبالشعير ونحو ذلك
Riyad as-Salihin 1671 
Ibn 'Abbas (May Allah be pleased with them) said:
The Messenger of Allah (ﷺ) said, "He who acquires a branch of the knowledge of astrology, learns a branch of magic (of which he acquires more as long as) he continues to do so."

[Abu Dawud].

وعن ابن عباس رضي الله عنهما قال‏:‏ قال رسول الله صلى الله عليه وسلم ‏:‏ ‏ "‏من اقتبس علمًا من النجوم، اقتبس شعبة من السحر زاد ما زاد‏"‏‏.‏ ‏(‏‏(‏رواه أبو داود بإسناد صحيح‏)‏‏)‏
Reference : Riyad as-Salihin 1671
In-book reference : Book 17, Hadith 161