R 刮掉需要点击按钮的网站

R 刮掉需要点击按钮的网站,r,web-scraping,rvest,R,Web Scraping,Rvest,我在努力刮。不幸的是,我想用rvest刮取的数据隐藏在一个按钮(加号)后面 我尝试使用rvest包执行此操作,并使用以下代码: library(rvest) url <- 'https://transparency.entsoe.eu/generation/r2/actualGenerationPerGenerationUnit/show?name=&defaultValue=true&viewType=TABLE&areaType=BZN&atch=fal

我在努力刮。不幸的是,我想用rvest刮取的数据隐藏在一个按钮(加号)后面

我尝试使用rvest包执行此操作,并使用以下代码:

library(rvest)
url <- 'https://transparency.entsoe.eu/generation/r2/actualGenerationPerGenerationUnit/show?name=&defaultValue=true&viewType=TABLE&areaType=BZN&atch=false&dateTime.dateTime=17.03.2017+00:00|UTC|DAYTIMERANGE&dateTime.endDateTime=17.03.2017+00:00|UTC|DAYTIMERANGE&area.values=CTY|10YBE----------2!BZN|10YBE----------2&productionType.values=B02&productionType.values=B03&productionType.values=B04&productionType.values=B05&productionType.values=B06&productionType.values=B07&productionType.values=B08&productionType.values=B09&productionType.values=B10&productionType.values=B11&productionType.values=B12&productionType.values=B13&productionType.values=B14&productionType.values=B15&productionType.values=B16&productionType.values=B17&productionType.values=B18&productionType.values=B19&productionType.values=B20&dateTime.timezone=UTC&dateTime.timezone_input=UTC&dv-datatable_length=100'

htmlpage <- html_session(url) %>%
  read_html() %>% 
  html_nodes(".dv-value-cell") %>>%
  html_table()
如您所见,这是原始url,但还有一个小的附加请求。但是,当我在浏览器中尝试此url时,它不会显示所需的结果。我必须错过的东西,该网站通过另外

根据Chrome,此请求的结果正是我要查找的数据(右键单击>复制>复制结果)。所以应该有一种方法可以下载这些特定的数据

我还发现了一个类似的问题,但不幸的是,这个问题的解决方案非常具体,没有给出一般性的解释


如何复制此浏览器请求,以便接收相同的表?

如果您没有废弃大量数据集。我建议您使用
selenium
。使用selenium,您可以单击按钮。您可以从开始。

您还可以使用PhantomJS。它也类似于selenium,但不需要浏览器。
我希望他们中的一个能帮上忙

https://transparency.entsoe.eu/...&dateTime.timezone_input=UTC&dv-datatable-detail_22WAMERCO000010Y_22WAMERCO000008L_length=10&dv-datatable_length=50&detailId=22WAMERCO000010Y_22WAMERCO000008L