0
このエラーがなぜ発生するのか分かりませんか?そのエラーがURLがHTTPSにリダイレクト意味...このニュースコンテンツを解析できません
site = "http://www.federalreserve.gov/feeds/prates.xml"
doc <- tryCatch(xmlParse(site), error=function(e) e);
Unknown IO errorfailed to load external entity
"http://www.federalreserve.gov/feeds/prates.xml"
src <- xpathApply(xmlRoot(doc), "//item")
Error in UseMethod("xmlRoot") :no applicable method for 'xmlRoot'applied to an object of class "c('XMLParserErrorList', 'simpleError', 'error',
'condition')"
for (i in 1:length(src)) {
if (i==1) {
foo<-xmlSApply(src[[i]], xmlValue)
temp<-data.frame(t(foo), stringsAsFactors=FALSE)
DATA=data.frame(title=temp$title,link=temp$link,description=temp$description,pubDate=temp$pubDate)
}
else {
foo<-xmlSApply(src[[i]], xmlValue)
temp<-data.frame(t(foo), stringsAsFactors=FALSE)
temp1=data.frame(title=temp$title,link=temp$link,description=temp$description,pubDate=temp$pubDate)
DATA<-rbind(DATA, temp1)
}
}
Error: object 'src' not found
XMLオブジェクトをURLではなく 'xmlParse'に渡す必要があります。 –
そのサイトは現在https:// –
です。@ chrisは関係ありません...私はXMLファイルを解析しています。 –