Skip to content

Instantly share code, notes, and snippets.

@Oreotrephes
Created April 3, 2021 01:01
Show Gist options
  • Save Oreotrephes/eb2d9f117ae60c576fb3fa3e28c1d79e to your computer and use it in GitHub Desktop.
Save Oreotrephes/eb2d9f117ae60c576fb3fa3e28c1d79e to your computer and use it in GitHub Desktop.
require(rvest)
output_file_name<-'output.txt'
for(i in 6174:45000){ #or 1, or whatever
url <- paste0("http://naeb.brit.org/uses/",i) #
message("Scraping ", url)
use_page_i <- read_html(paste0("http://naeb.brit.org/uses/",i))
links_i <- use_page_i %>% html_elements("a")
species_i <- links_i[8] %>% html_text2()
write(species_i,file=output_file_name,append=TRUE)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment