Skip to content

Commit

Permalink
Adiciona warning nem to inutil assim
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusHALeal committed Dec 8, 2019
1 parent 23dc067 commit c7913a1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions R/album_scraper.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ get_album_critic_reviews <- function(name, artist) {
album_page_url <- paste0(WEBSITE_URL, MUSIC, .format_name_to_url(name), "/", .format_name_to_url(artist))
remote_driver$navigate(paste0(album_page_url, "/critic-reviews"))
Sys.sleep(3)
element <- tryCatch(
{
remote_driver$findElement(using='class', value='reviews')
},
error = function(e){
warning("Album not found")
return()
}
)

element <- remote_driver$findElement(using='class', value='reviews')
element_text <- element$getElementText()
ad <- remote_driver$findElement(using='id', value='native_top')
Expand Down

0 comments on commit c7913a1

Please sign in to comment.