FantasyFootballAnalytics / ffanalytics

ffanalytics R package
http://ffanalytics.fantasyfootballanalytics.net/
162 stars 101 forks source link

FantasyPros Weekly scrape returns no data #37

Closed RandalMorris closed 2 years ago

RandalMorris commented 5 years ago

The current setup will cause FantasyPros to default to the normal Position page which is for the draft, but when you enter anything other than week == 0 then you still get the default page.

Below is my fix in the source_configs.R. I'm not sure exactly how pull requests work so ill leave it here. I used the CBS list as a basis and change toupper to tolower. Changing tolower may actually fix it anyway as the position on the site in lowercase

FantasyPros = list( base = "https://www.fantasypros.com/nfl/projections/", get_path = function(season, week, position){ period <- ifelse(week == 0, "draft", as.character(week)) paste(tolower(position),".php?week=",period, sep = "")},

get_path = function(season, week, position)paste0(tolower(position), ".php"),

#get_query = function(season, week, pos_id, ...){
#  if(week == 0)
#    return(list(week = "draft"))
#}
get_query = NULL,
isaactpetersen commented 5 years ago

Posting this here in case anyone is interested in helping with the project: https://fantasyfootballanalytics.net/2019/09/call-for-help-lead-r-shiny-developer.html