0

我希望从示例 URL https://www.valueresearchonline.com/funds/fundSelector/returns.asp?cat=10&exc=susp%2Cclose&rettab=st中提取带有排名和返回的表格

到目前为止尝试过 rvest

#Reading the HTML code from the website
webpage <- read_html(urlString)

#Using CSS selectors to scrap the section
tables <- webpage %>% html_node("tr") %>% html_text()
tables <- html_node(".fundtool_cat") %>% html_text()

我需要一个带有方案名称的数据框/表,以及提到的所有时期的排名和回报

4

1 回答 1

2
library(rvest)
urlString <- "https://www.valueresearchonline.com/funds/fundSelector/returns.asp?cat=10&exc=susp%2Cclose&rettab=st"
urlString %>%
  read_html() %>%
  html_nodes(xpath='//*[@id="fundCatData"]/table[1]') %>%
  html_table(fill=T)
于 2017-09-07T19:58:27.530 回答