0

I would like to scroll down until the page is full loaded with new records:

library(RSelenium)
rD <- RSelenium::rsDriver(browser = "firefox", check = FALSE)
remDr <- rD[["client"]]

remDr$navigate("https://investmentpolicy.unctad.org/international-investment-agreements")

remDr$findElement("link text", "Advanced Search")$clickElement()
remDr$findElement("id", "search-button")$clickElement()
Earl Mascetti
  • 1,278
  • 3
  • 16
  • 31
Mohamed
  • 95
  • 7

1 Answers1

0

One solution could be

library(RSelenium)
rD <- RSelenium::rsDriver(browser = "firefox", check = FALSE)
remDr <- rD[["client"]]

remDr$navigate("https://investmentpolicy.unctad.org/international-investment-agreements")

#Find in the css enviroment the body   
scroll_d <- remDr$findElement(using = "css", value = "body")

#send to the browser to go to the end of the page. You could iterate it by a for loop
scroll_d$sendKeysToElement(list(key = "end"))
Earl Mascetti
  • 1,278
  • 3
  • 16
  • 31