Skip to content

Instantly share code, notes, and snippets.

@jthomasmock
jthomasmock / fantasy_pros_scrape.R
Last active November 15, 2020 15:17
Scraping Fantasy projections from fantasypros.com
library(tidyverse)
library(glue)
library(rvest)
# Function to scrape the top avg cap salary by player ----
scrape_projections <- function(position, week) {
if (position == "qb") {
naming <- c("", "PASS", "PASS", 'PASS', "PASS", "PASS", "RUSH", "RUSH", "RUSH", "", "")
} else if (position == "rb") {