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. (Using translation from Abū Dāʾūd 3905)
قَالَ رَسُولُ اللهِ ﷺ مَنِ اقْتَبَسَ عِلْمًا مِنَ النُّجُومِ اقْتَبَسَ شُعْبَةً مِنْ سِحْرٍ مَا زَادَ زَادَ وَمَا زَادَ زَادَ