Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/383.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R-Web使用V8抓取JavaScript对象_Javascript_R_Web Scraping_V8_Rvest - Fatal编程技术网

R-Web使用V8抓取JavaScript对象

R-Web使用V8抓取JavaScript对象,javascript,r,web-scraping,v8,rvest,Javascript,R,Web Scraping,V8,Rvest,我在R方面有一些经验,但对JavaScript完全陌生。我最近正试图从这张桌子上刮一张桌子()。在我看来,该网页是用JavaScript编写的,因此使用rvest进行刮取的简单方法不起作用。如果表格是纯HTML格式的,下面是我需要的刮表方法: library(rvest) link <- "http://op1.win007.com/Oddslist/1599893.htm" MyTable <- read_html(link) %>% html_nodes("oddsList

我在R方面有一些经验,但对JavaScript完全陌生。我最近正试图从这张桌子上刮一张桌子()。在我看来,该网页是用JavaScript编写的,因此使用rvest进行刮取的简单方法不起作用。如果表格是纯HTML格式的,下面是我需要的刮表方法:

library(rvest)
link <- "http://op1.win007.com/Oddslist/1599893.htm"
MyTable <- read_html(link) %>% html_nodes("oddsList_tab") %>% html_table(fill = TRUE)
库(rvest)
链接%html\u表(fill=TRUE)
上面的代码给了我一个空列表,这不是我想要的。在阅读其他文章和V8教程后,我得出以下结论:

library(rvest)
library(V8)
link <- "http://op1.win007.com/Oddslist/1599893.htm"

MyText <- read_html(link) %>% html_nodes('script') %>% html_text()

ct <- v8()
html_nodes(MyText, "oddsList_tab") %>% html_text() %>% ct$eval()
库(rvest)
图书馆(V8)
链接%html\u text()
ct%html_text()%%>%ct$eval()
我不知道哪一部分是错的,因为我是JavaScript新手。此外,我还想得到弹出式表格,将鼠标悬停在表格内的数字上。显然,我不知道该怎么做,因为我很难把桌子刮到表面上

我从其他帖子上读到,它可能需要填写一些变量,但我不知道我是否必须这样做,以及如何才能做到这一点

如果有人能告诉我怎么做,并可能向我解释它是如何工作的,那就太好了

多谢各位