Narrated Abdullah ibn Abbas:
The Prophet (ﷺ) said: If anyone acquires any knowledge of astrology, he acquires a branch of magic of which he gets more as long as he continues to do so.
Narrated Abdullah ibn Amr ibn al-'As:
I used to write everything which I heard from the Messenger of Allah (ﷺ). I intended (by it) to memorise it. The Quraysh prohibited me saying: Do you write everything that you hear…
حَدَّثَنَا أَبُو بَكْرٍ، حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ، عَنْ عُبَيْدِ اللَّهِ بْنِ الأَخْنَسِ، عَنِ الْوَلِيدِ بْنِ عَبْدِ اللَّهِ، عَنْ يُوسُفَ بْنِ مَاهَكَ، عَنِ ابْنِ عَبَّاسٍ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ " مَنِ اقْتَبَسَ عِلْمًا مِنَ النُّجُومِ اقْتَبَسَ شُعْبَةً مِنَ السِّحْرِ زَادَ مَا زَادَ " .
It was narrated from Ibn Abbas that the Messenger of Allah(ﷺ) said:
"Whoever learns about the stars, he learns a branch of magic; the more he learns (of the former) the more he learns (of the latter)."