Stub out section to scrape state data from AE7Q.

This commit is contained in:
mattbk 2024-04-21 21:38:12 -05:00
parent 98eef8a2fd
commit 647d6df134

View File

@ -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,