我觉得从隐藏的iframe的部分(AT-至少它似乎为我做的跨域策略块你)但你可以下载表格并显示它,
rm(list = ls())
library(shiny)
ui
tags$head(
tags$script(
HTML(
'
$(document).ready(function(){
// Should work if not blocked
$("#myiframe").attr("src","http://www.investing.com/quotes/streaming-forex-rates-%E2%80%93-majors");
$("#myiframe").load(function(){
console.log("UPDATED");
var iframe = $("#myiframe").contents(),
tbl = iframe.find("#cr1").clone();
iframe.find("html").replaceWidth(tbl);
});
});
'
)
)
),
titlePanel("Getting A specific div from external website"),
mainPanel(fluidRow(
tags$iframe(id="myiframe",seamless="seamless",src="", height=600, width=1000),
dataTableOutput("tbl1")
)
)
))
library(httr)
library(XML)
server
url
page.DOM
tables
exchng.tbl
# cr1
output$tbl1
exchng.tbl
})
})
shinyApp(ui, server)