Scraping Fantasy Football Projections from the Web
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
In this post, I show how to download fantasy football projections from the web using R. In prior posts, I showed how to scrape projections from ESPN, CBS, NFL.com, and FantasyPros. In this post, I compile the R scripts for scraping projections from these sites, in addition to the following sites: Accuscore, FantasySharks, FFtoday, FOX Sports, and Yahoo.
Why Scrape Projections?
Scraping projections from multiple sources on the web allows us to automate importing the projections with a simple script. Automation makes importing more efficient so we don’t have to manually download the projections whenever they’re updated. Once we import all of the projections, there’s a lot we can do with them, like:
- Determine who has the most accurate projections
- Calculate projections for your league
- Calculate players’ risk levels
- Calculate players’ value over replacement
- Identify sleepers
- Calculate the highest value you should bid on a player in an auction draft
- Draft the best starting lineup
- Win your auction draft
- Win your snake draft
The R Scripts
To scrape the projections from the websites, I use the readHTMLTable function from the XML package in R. Here’s an example of how to scrape projections from FantasyPros:
The R Scripts for scraping the different sources are located below:
- Accuscore
- CBS - Jamey Eisenberg
- CBS – Dave Richard
- CBS – Average
- ESPN
- FantasyPros
- FantasySharks
- FFtoday
- FOX Sports
- NFL.com
- Yahoo
Density Plot
Below is a density plot of the projections from the different sources:
Conclusion
Scraping projections from the web is fast, easy, and automated with R. Once you’ve downloaded the projections, there’s so much you can do with the data to help you win your league! Let me know in the comments if there are other sources you want included (please provide a link).
The post Scraping Fantasy Football Projections from the Web appeared first on Fantasy Football Analytics.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.