Web scraping looping through list of IDs and years in R
问题 I'm trying to scrape game logs of every MLB player dating back to 2000 from baseball-reference.com using R. I've read a ton of stuff that is helpful, but not exactly extensive enough for my purposes. The URL for say, Curtis Granderson's 2016 game logs is https://www.baseball-reference.com/players/gl.fcgi?id=grandcu01&t=b&year=2016. If I have a list of player IDs and years I know I should be able to loop through them somehow with a function similar to this one that grabs attendance by year: