我尝试抓取网站的链接,然后按照它抓取数据,但是这些链接位于Javascript下拉菜单中。我使用了以下代码,但返回了错误。
library('rvest')
library('dplyr')
library('tidyr')
review <- "http://hk.racing.nextmedia.com/fullresult.php?date=20160903&page=01"
obor <- html_nodes(review, "selected>選擇賽日</option>")%>%
obor_df <- data_frame(
value=xml_attr(obor, "value"),
option=xml_text(obor)
)
obor
Error in UseMethod("xml_find_all") :
no applicable method for 'xml_find_all' applied to an object of class "character"
有什么想法可以解决吗?