错误:XML内容似乎不是XML. R 3.1.0 [英] Error: XML Content does not seem to be XML | R 3.1.0

查看:76
本文介绍了错误:XML内容似乎不是XML. R 3.1.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取此XML文件,但无法.我检查了同一主题中的其他解决方案,但我听不懂.我是R新手.

I am trying to get this XML file, but am unable to. I checked the other solutions in the same topic, but I couldn't understand. I am a R newbie.

> library(XML)
> fileURL <- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Frestaurants.xml"
> doc <- xmlTreeParse(fileURL,useInternal=TRUE)

错误:XML内容似乎不是XML:' https://d396qusza40orc.cloudfront. net/getdata%2Fdata%2Frestaurants.xml '

Error: XML content does not seem to be XML: 'https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Frestaurants.xml'

可以帮忙吗?

推荐答案

https

library(XML)

fileURL<-"https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Frestaurants.xml"
doc <- xmlTreeParse(sub("s", "", fileURL), useInternal = TRUE)
class(doc)
## [1] "XMLInternalDocument" "XMLAbstractDocument"

这篇关于错误:XML内容似乎不是XML. R 3.1.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆