【发布时间】:2015-02-02 16:28:04
【问题描述】:
我尝试从以下站点提取数据:
https://www.zomato.com/ncr/restaurants/north-indian
使用 R 编程,我是这个领域的学习者和初学者!
我试过这些:
> library(XML)
> doc<-htmlParse("the url mentioned above")
> Warning message:
> XML content does not seem to be XML: 'https://www.zomato.com/ncr/restaurants/north-indian'
这是一个...我还尝试了readLines(),其输出如下:-
> readLines("the URL as mentioned above") [i can't specify more than two links so typing this]
> Error in file(con, "r") : cannot open the connection
> In addition: Warning message:
> In file(con, "r") : unsupported URL scheme
我知道该页面不是错误说明中显示的 XML,但是我有什么其他方法可以从该站点捕获数据...我确实尝试过 tidy html 将其转换为 XML 或 XHTML 然后工作它起来了,但我无处可去,也许我还不知道使用 tidy html 的实际过程! :( 不确定! 提出解决此问题的建议和更正(如果有的话)?
【问题讨论】:
标签: html xml r web-scraping readlines