我试图通过使用R中的“天才”包从特定歌曲中获得歌词,我使用了软件包中的功能:
kendrick <- gen_song_url("Kendrick Lamar","Humble")
genius_url(kendrick, info = "all")从“肯德里克”中,我得到了天才网页上歌词的网址。但是,当我使用函数genius_url时,我会得到以下错误消息:
stream$next_ident()中的错误:期望in,在2>处得到
但我不明白。有人也有同样的问题吗?
发布于 2021-12-21 09:36:44
有人提出了一个问题,这里是https://github.com/JosiahParry/genius/issues/62
如果你需要歌词,你可以使用rvest包
library(rvest)
library(dplyr)
kendrick %>% read_html() %>%
html_nodes('.Lyrics__Container-sc-1ynbvzw-6') %>%
html_text()
[1] "[Intro]Nobody pray for meIt been that day for meWay (Yeah, yeah)[Verse 1]Ayy, I remember syrup sandwiches and crime allowancesFinesse a nigga with some counterfeits, but now I'm countin’ thisParmesan where my accountant lives, in fact I'm downin' thisD’USSÉ with my boo bae tastes like Kool-Aid for the analystsGirl, I can buy your ass the world with my paystubOoh, that pussy good, won't you sit it on my taste bloodhttps://stackoverflow.com/questions/70422586
复制相似问题