Skip to content

Commit

Permalink
#2
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrizmilz committed Apr 13, 2024
1 parent eb8b1f0 commit a990b73
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions R/buscar_conteudo_pagina_instrucoes.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ buscar_conteudo_pagina_instrucoes <- function(caminho_arquivo,

data_obtencao_informacao <- stringr::str_extract(caminho_arquivo, "[0-9]{4}-[0-9]{2}-[0-9]{2}")

# Adicionar: data de atualização do site!
data_atualizacao_pagina <- rvest::read_html(caminho_arquivo) |>
rvest::html_element("body") |>
rvest::html_element(".page-updated-at") |>
rvest::html_text() |>
stringr::str_trim() |>
stringr::str_extract("[0-9]{2}/[0-9]{2}/[0-9]{4}")

html_lista <- rvest::read_html(caminho_arquivo) |>
rvest::html_element("body") |>
rvest::html_elements(".col-sm-12")
Expand Down Expand Up @@ -45,7 +51,8 @@ buscar_conteudo_pagina_instrucoes <- function(caminho_arquivo,
id_periodico = id_periodico,
.before = tidyselect::everything(),
) |>
dplyr::mutate(data_obtencao_informacao = data_obtencao_informacao)
dplyr::mutate(data_obtencao_informacao = data_obtencao_informacao,
data_atualizacao_pagina = data_atualizacao_pagina)


if(isTRUE(salvar_localmente)){
Expand Down

0 comments on commit a990b73

Please sign in to comment.