Skip to content

Commit

Permalink
Update gov_website.R
Browse files Browse the repository at this point in the history
  • Loading branch information
xinzhuohkust committed Jan 29, 2024
1 parent 00d66e6 commit 90b5e24
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions gov_website.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ library(httr2)
library(rio)

done <- list.files("/home/runner/work/auto_web_crawling/auto_web_crawling/data/table", pattern = "csv", full.names = TRUE) %>%
map_dfr(~ import(., setclass = "tibble")) %>%
distinct(id, .keep_all = TRUE) %>%
mutate(across(everything(), as.character)) %>%
tibble()
map_dfr(~ import(., setclass = "tibble") |> mutate(across(everything(), as.character))) %>%
distinct(id, .keep_all = TRUE)

extract_info <- possibly(
insistently(
Expand Down Expand Up @@ -62,9 +60,11 @@ for (i in 1:ceiling(total / 10)) {
}

table <- info[info != "error!"] %>%
map_dfr(\(x) fromJSON(x) |> pluck("body")) %>%
mutate(across(everything(), as.character)) %>%
tibble()
map_dfr(
\(x) fromJSON(x) |>
pluck("body") |>
mutate(across(everything(), as.character))
)

export(
table,
Expand Down

0 comments on commit 90b5e24

Please sign in to comment.