In this study, a novel boronic acid-functionalized magnetic porphyrin-based covalent organic framework (COF) with a core-shell structure was designed and synthesized for the selective enrichment and detection of nucleosides. Firstly, brominated porphyrin-based COF was in situ grown on Fe3O4-NH2 nanospheres (denoted as Fe3O4@Br-COF), then a post-synthetic modification strategy was used to introduce boronic acid into the framework via Suzuki-Miyaura cross-coupling reaction to obtain boronic acid functionalized magnetic COF (denoted as Fe3O4@BA-COF). Suzuki-Miyaura cross-coupling possesses the advantages of mild synthesis conditions, high tolerance to functionalities, and ease of handling and separation, which is considered as a promising candidate for functionalizing COF. It is worth mentioning that the porphyrin-based COF possesses a unique nitrogen-rich skeleton and “trap” structure formed by four pyrrole rings, which can provide hydrogen bond and make it more suitable for trapping analytes than other types of COF. The boronic acid group provides boronate affinity, which enables better selective enrichment of cis-diol-containing nucleoside. The morphology and structure of the prepared Fe3O4@BA-COF was characterized by various methods. Based on the Fe3O4@BA-COF, a facile magnetic solid phase extraction coupled with high performance liquid chromatography method (MSPE-HPLC) was used to extract and detect adenosine, guanosine, uridine, and cytidine in urine samples. This work not only provides a mild and feasible post-synthetic modification method for fabrication of boronic acid-functionalized magnetic COF, but also provides an efficient and rapid method to selectively enrich and detect hydrophilic nucleosides.