Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:16513ʿAlī b. Aḥmad b. ʿAbdān > Aḥmad b. ʿUbayd > Ismāʿīl b. Isḥāq > ʿAlī b. ʿAbdullāh > Yaḥyá b. Saʿīd > ʿUbaydullāh b. al-Akhnas > al-Walīd b. ʿAbdullāh > Yūsuf b. Māhak > Ibn ʿAbbās

[Machine] The Messenger of Allah ﷺ said, "Whoever takes knowledge from the stars, he has taken a branch of sorcery. And whatever increases, increases." Isma'il reported to us about it from Ali in another place, and he said in it about Ibn Abbas that he said, "I heard the Prophet ﷺ saying," and then he mentioned the hadith.  

البيهقي:١٦٥١٣أَخْبَرَنَا عَلِيُّ بْنُ أَحْمَدَ بْنِ عَبْدَانَ أَنْبَأَ أَحْمَدُ بْنُ عُبَيْدٍ ثَنَا إِسْمَاعِيلُ بْنُ إِسْحَاقَ ثَنَا عَلِيُّ بْنُ عَبْدِ اللهِ ثَنَا يَحْيَى بْنُ سَعِيدٍ ثَنَا عُبَيْدُ اللهِ بْنُ الْأَخْنَسِ حَدَّثَنِي الْوَلِيدُ بْنُ عَبْدِ اللهِ عَنْ يُوسُفَ بْنِ مَاهَكَ عَنِ ابْنِ عَبَّاسٍ

أَنَّ رَسُولَ اللهِ ﷺ قَالَ مَنِ اقْتَبَسَ عِلْمًا مِنَ النُّجُومِ اقْتَبَسَ شُعْبَةً مِنَ السِّحْرِ فَمَا زَادَ زَادَ قَالَ إِسْمَاعِيلُ أَخْبَرَنَا بِهِ عَلِيٌّ فِي مَوْضِعٍ آخَرَ فَقَالَ فِيهِ عَنِ ابْنِ عَبَّاسٍ قَالَ سَمِعْتُ النَّبِيَّ ﷺ يَقُولُ ثُمَّ ذَكَرَ الْحَدِيثَ