【发布时间】:2021-04-19 15:38:55
【问题描述】:
我正在尝试从网页中提取两段文本
网页
page <- read_html("https://www.decathlon.fr/p/kettlebell-12kg/_/R-p-152874")
以及我要提取的部分文本的 html 源代码
<p class="ab-info-stock__text ab-test-info-red">Rupture de stock sur cette taille</p>
我尝试使用rvest 提取它,但它似乎不起作用
library(rvest)
element = page %>% html_nodes("ab-info-stock__text ab-test-info-red")
非常感谢一些关于我哪里出错的帮助。
【问题讨论】: