0

我正在尝试从这些页面中提取表格(https://spactrack.net/activespacs/https://warrants.tech/)。我正在使用 Rcrawler 包来提取它们,但是当我运行下面的代码时它给我一个错误。

library(rvest)
library(xml2)
library(Rcrawler)

#install_browser(version = "2.1.1",
                 baseURL = "https://github.com/wch/webshot/releases/download/v0.3.1/")

LS <- browser_path()

#to extract from the first link

url <- "https://spactrack.net/activespacs/"

table <- ContentScraper(Url = url, 
                 XpathPatterns = c("/html/body/section/div/div[2]/div/div/div[2]/div[2]/table"),
                  asDataFrame = TRUE, browser = LS)

#to extract from the second link:

url2 <- "https://warrants.tech/"

table2 <- ContentScraper(Url = url2, 
          XpathPatterns = c("/html/body/div[1]/div/div[2]/div[1]/div[2]/div/div[2]/div/div/div/table"),
          asDataFrame = TRUE, browser = LS)

你能帮我提取这些表吗?谢谢你。

4

0 回答 0