Skip to content

Commit

Permalink
Update tjsp_ler_movimentacao.R
Browse files Browse the repository at this point in the history
  • Loading branch information
jjesusfilho authored Sep 12, 2023
1 parent 5bc2fc8 commit 8cae5f3
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions R/tjsp_ler_movimentacao.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,11 @@ tjsp_ler_movimentacao <- function(arquivos = NULL,diretorio = ".") {
resposta <- xml2::read_html(.x)


processo <- resposta |>
xml2::xml_find_first("//span[contains(@class,'unj-larger')]") |>
xml2::xml_text() |>
stringr::str_squish() |>
stringr::str_remove_all("[^\\d+\\s]") |>
stringr::str_trim()

cd_processo <- resposta |>
xml2::xml_find_first("//script[contains(text(),'processo.codigo')]") |>
xml2::xml_text() |>
stringr::str_extract("(?<=processo.codigo=)\\w+")
processo <- .x |>
stringr::str_extract("\\d{20}")

cd_processo <- .x |>
stringr::str_extract("(?<=cd_processo_)\\w+")

texto <- resposta |>
xml2::xml_find_first(xpath = "//table/tbody[@id='tabelaTodasMovimentacoes']")
Expand Down

0 comments on commit 8cae5f3

Please sign in to comment.