【发布时间】:2019-04-15 02:39:17
【问题描述】:
我正在尝试抓取https://www.yachtfocus.com/boten-te-koop.html#price=10000%7C30000&length=9.2%7C&super_cat_nl=Zeil。我正在使用 R 包 read_html 和 rvest。我使用以下代码执行此操作:
library('rvest')
#scrape yachtfocus
url <- "https://www.yachtfocus.com/boten-te-koop.html#price=10000|30000&length=9.2|&super_cat_nl=Zeil"
webpage <- read_html(url)
#Using CSS selectors to scrap the rankings section
amount_results_html <- html_node(webpage,".res_number")
#create text
amount_results <- html_text(amount_results_html)
使用 url 中提供的过滤器时,这不会返回预期值,而是返回“未过滤”值。所以当我使用时也是如此:
url <- "https://www.yachtfocus.com/boten-te-koop.html"
webpage <- read_html(url)
我可以“强制”read_html 正确执行过滤器参数吗?
【问题讨论】: