#' webscrap_lyrics
#'
#' @description Funcao para montagem da tabela de letras das musicas
#'
#' @return Um dataframe com todas letras das musicas, para cada artista do
#' genero gospel, encontradas no portal do vagalume.
#'
#'
#' @noRd
webscrap_lyrics <- function() {
load("data/musics.rda")
future::plan(future::multisession, workers = 20)
furrr::future_map_dfr(1:nrow(musics), function(id_music) {
tryCatch({
music <- musics[id_music,]
u <- glue::glue("https://www.vagalume.com.br{music$href}")
lyrics <- rvest::read_html(u) |>
rvest::html_elements(xpath = "//div[@id='lyrics']") |>
rvest::html_text2()
dplyr::mutate(music, href = NULL, lyric = lyrics)
}, error = function(e) {dplyr::mutate(music, href = NULL, lyric = NA)})
}, .progress = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.