R code for basic scraping functions