Skip to content

Instantly share code, notes, and snippets.

@erikgregorywebb
Created February 7, 2023 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikgregorywebb/bca4df8056677a81e846ed9e8ce232ee to your computer and use it in GitHub Desktop.
Save erikgregorywebb/bca4df8056677a81e846ed9e8ce232ee to your computer and use it in GitHub Desktop.
library(rvest)
url = 'https://mesamarathon.com/results?pk=7675253'
page = read_html(url)
paths = page %>% html_nodes('.photo') %>% html_attr('src') %>% str_replace(., '_thumb', '')
setwd("~/Downloads")
for (i in 1:length(paths)) {
file_name = paste('file-kristin-', i, '.jpg', sep = '')
download.file(paths[i], file_name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment