【发布时间】:2016-01-07 18:48:22
【问题描述】:
我正在抓取页面 tata safari discription 以获取评论和用户 cmets。我正在使用选择器小工具来获取 css 标记。到目前为止我所做的事情是:
teambhp <- read_html("http://www.team-bhp.com/forum/official-new-car-reviews/171841-tata-safari-storme-varicor-400-official-review.html")
titles <- teambhp %>% html_node("hr+ div , i ,strong u , #posts ") %>% html_text()
但它只保存了一个 title inn 标题变量。并给出如下警告。
Warning message:
In node_find_one(x$node, x$doc, xpath = xpath, nsMap = ns) :
23 matches for .//hr/following-sibling::*[name() = 'div' and (position() = 1)] | .//i | .//strong/descendant-or-self::*/u | .//*[@id = 'posts']:
using first
我希望所有 23 个都保存在列表中。我该怎么做?
【问题讨论】: