I'm trying to scrape the following webpage in R using the XML, RCurl, or httr libraries: http://accuscore.com/fantasy-sports/nfl-fantasy-sports/Rest-of-Season-RB
The webpage opens correctly in my browser. Here are my attempts to scrape the webpage:
library("XML")
#this works fine (QB projections)
qb <- readHTMLTable("http://accuscore.com/fantasy-sports/nfl-fantasy-sports/", header=1)$fantasy_table
#this does not (RB projections)
rb <- readHTMLTable("http://accuscore.com/fantasy-sports/nfl-fantasy-sports/Rest-of-Season-RB", header=1)$fantasy_table
library("RCurl")
htmlParse("http://accuscore.com/fantasy-sports/nfl-fantasy-sports/Rest-of-Season-RB")
library("httr")
GET("http://accuscore.com/fantasy-sports/nfl-fantasy-sports/Rest-of-Season-RB")
I receive the following error with readHTMLTable and htmlParse: "Error: failed to load HTTP resource". With GET, I receive a status code 404, which suggests that the resource could not be found and that there may be a mistake in the way I'm sending the request. Given that I can open the webpage in my browser, I'm not sure what the problem is. Maybe it's a different kind of file than the functions are expecting? Any ideas?
Ideally, the scrape would be for all 146 entries (not just the first 25).