Followers

Friday, 1 July 2016

Scraping website with R: XML content does not seem to be XML

Source: stackoverflow.com --- Thursday, June 30, 2016
I'm trying to scrape the table from a website ( http://ift.tt/29fhZPIFootball/rankings/quarterbacks ) and I've tried several approaches without success. When I run the code below, I get the following error: XML content does not seem to be XML library("XML") library("RCurl") readHTMLTable("http://ift.tt/29fhZPIFootball/rankings/quarterbacks") None of the approaches below using RCurl worked either: rts.url <- getURL("http://ift.tt/29fhZPIFootball/rankings/quarterbacks") xmlParse(rts.url) xmlInternalTreeParse(rts.url) readHTMLTable(rts.url) No success with httr : library("httr") GET("http://ift.tt/29fhZPIFootball/rankings/quarterbacks") No success with rvest : library("rvest") read_html("http://ift.tt/29fhZPIFootball/rankings/quarterbacks") ...



from Football http://ift.tt/296bwCT

No comments:

Post a Comment