web scrapping lyrics on genius API

Hi! I was trying to get the lyrics of the songs of a singer (rosalia). There are 87 songs, taken from Genius.

I have a table where the first column is the urls of the songs, and in the second column the title of the songs. I created a third column for the lyrics.

URL ex. ROSALÍA – Aute Cuture Lyrics | Genius Lyrics

I try to do web scraping with this code, but it doesn't work.

for (i in 1:87) {
  rosalia_lyrics$letras[i] = read_html(rosalia_lyrics$enlaces[i]) %>% html_nodes("lyrics") %>% html_text()}

1 Like

The answer is:

Error in rosalia_lyrics$letras[i] <- read_html(rosalia_lyrics$enlaces[i]) %>% :
replacement has length zero

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.