diff --git a/bin/scrape-license-counts.R b/bin/scrape-license-counts.R index 45cd1d6..3e3abe9 100644 --- a/bin/scrape-license-counts.R +++ b/bin/scrape-license-counts.R @@ -49,7 +49,6 @@ write.table(tab, file = "out/arrl-fcc-licenses-scraped.csv", sep = ",", # na = "") ###### HamCall ###### - hamcall_url <- "https://hamcall.net/hamcallcounts.html" # Read the page @@ -106,7 +105,33 @@ hamcall_table_state <- hamcall_table_state_raw %>% source_detail = hamcall_url) %>% relocate(date, State, Count, source_name, source_detail) -# Append tables + +###### AE7Q ###### +ae7q_url <- "https://www.ae7q.com/query/stat/LicenseUSA.php" + +# Read the page +ae7q_raw <- read_html(ae7q_url) + +# Get tables and clean up +ae7q_tables <- ae7q_raw %>% + html_elements(xpath = "//table") %>% + html_table() +ae7q_table_state <- ae7q_tables[[20]] +# Fix names +names(ae7q_table_state) <- ae7q_table_state[1,] +ae7q_table_state <- ae7q_table_state[-1,] + +# TODO +# split percents out into other columns (separate_wider_delim() ?) +# etc. + + + + + + + +##### Append tables ##### write.table(hamcall_table_class_pivot, file = "out/hamcall-licenses-scraped.csv", sep = ",", append = TRUE, quote = FALSE, col.names = F, row.names = FALSE,