首页 > 解决方案 > 同时 rvest 多个文本行

问题描述

我正在刮Udemy课程,我想刮右边的激励:

在此处输入图像描述

他们所有的 css 都是.incentives__text.

这是网址:

  url <- read_html("https://www.udemy.com/linux-linux-security-masterclass-3-in-1/")

  incentives <- list()

  incentives <- url %>%
            html_nodes(".incentives__item") %>% # isloate the text
            html_text() # get the text

这只是刮了第一行,但我想一次刮掉所有的奖励。我该怎么做?

标签: rrvest

解决方案


推荐阅读