Skip to content

Commit

Permalink
Réparer CBC (encore)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementCadieux committed Mar 28, 2023
1 parent 0d92641 commit 81ed4a9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pipelines/extractors/e_radar+.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ harvest_headline <- function(r, m) {
rvest::html_nodes('a') %>%
rvest::html_attr("href")

if(length(CBC_extracted_headline) == 0){
CBC_extracted_headline <<- r %>%
rvest::html_nodes(xpath = '//*[@class="primaryHeadline desktopHeadline"]') %>%
rvest::html_nodes('a') %>%
rvest::html_attr("href")
}

if (grepl("^http.*", CBC_extracted_headline[[1]])) {
url <- CBC_extracted_headline[[1]]
} else {
Expand Down

0 comments on commit 81ed4a9

Please sign in to comment.