Why can't I scrape the following table

只谈情不闲聊 提交于 2019-12-12 04:26:00

问题


I'm using the code below in order to scrape a webpage's list.The result that I get is only the table's header.How can I scrape the whole table?

library(rvest)
theurl <- "http://www.forbes.com/midas/list/"
file<-read_html(theurl)
tables<-html_nodes(file, "table")
table1 <- html_table(tables[2], fill = F)
table1
c<-as.data.frame(lapply(table1, stack))
summary(c$values)
head(c$values)

来源:https://stackoverflow.com/questions/39033432/why-cant-i-scrape-the-following-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!