【发布时间】:2017-03-21 02:21:22
【问题描述】:
我想计算解析文本中小于 x 的数字的数量。
这是给我列表的代码:
library(rvest)
library(reshape2)
td <- read_html(x = "http://www.imdb.com/name/nm1287124/?ref_=tt_ov_dr")
list<- as.list(td %>% # feed `main.page` to the next step%>% # load the page
html_nodes(".filmo-row") %>% # isloate the text
html_text())
有人知道如何计算例如小于 2017 年的数字吗?
(未完成;最终目标是计算某一年之前的导演学分)
【问题讨论】:
-
请注明您正在使用的所有包。
-
rvest 和 reshape2
标签: r parsing web-scraping imdb