I am new to parsing XML files and am having trouble doing so. I have tried using the following R code using libraries XML and RCurl
xml_data<- xmlParse('http://ift.tt/1y2iApk')
xml_list<- xmlToList(xml_data)
Got the following message: Error: "XML content does not seem to be XML" after running the xmlParse line. To my newbie knowledge it is an xml and there is a scheme stated.
So I switched to htmlParse and received the same message. So then I tried
fileURL <- "http://ift.tt/1y2iApk"
xdata<- getURL(fileURL)
At that point I got a SSL error and after reading at omega hat I changed it to
xdata<- getURL(fileURL, ssl.verifypeer = FALSE, useragent= "R")
The error states: Error in function (type, msg, asError=TRUE) : error:1411809D:SSL
So instead I switched ssl.verifypeer to TRUE
xdata<- getURL(fileURL, ssl.verifypeer = TRUE, useragent= "R")
This gave me another error: Error in merge(list(....), .opts: argument is missing, with no default.
I have researched Stackexchange, the library pdfs and the documentation at omegahat yet cannot seem to get it right. Appreciate the help.
No comments:
Post a Comment