Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fg_team_pitcher function does not work #308

Open
jtrain907 opened this issue Aug 13, 2023 · 5 comments
Open

fg_team_pitcher function does not work #308

jtrain907 opened this issue Aug 13, 2023 · 5 comments

Comments

@jtrain907
Copy link

fg_team_pitcher does not work, returning the issue:

2023-08-13 10:22:28: Invalid arguments or no team data available!
Error in fg_team_pitcher(x = 2015, y = 2015, qual = 150) :
object 'leaders' not found

It looks like this was an issue recently due to something that changed on fangraphs' end.

@rdavtian
Copy link

I'm having the same error with fg_bat_leaders() and fg_pitch_leaders() functions.

@jtrain907
Copy link
Author

I did an uninstall and reinstall of baseballr yesterday, which fixed it. Then, this morning, I'm having the same issue.

@jtrain907
Copy link
Author

Believe it's something wrong with 'table.rgMasterTable' here that changed on Fangraph's end. I didn't have time to look into what the proper html_element would be instead, the few I tried quickly returned empty tables.

        leaders <- payload %>%
          rvest::html_elements("table.rgMasterTable") %>% 
          rvest::html_table()

@camdenk
Copy link
Collaborator

camdenk commented Aug 17, 2023

I'll take a look tonight and see what the issue is.

FanGraphs put out something earlier this year saying they'll be changing their site around which would ultimately result in scrapers not working for their leaderboards (though they'll have another page that matched the old style but that page also wouldn't last forever)

@jtrain907
Copy link
Author

I hope there's a workable solution! I just built a next stage of a project I have been building out based on the pitching leaderboards, so would be painful to see it go. Manual fangraph csv exports might work for me, though it won't be ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants