I have an R code using RSelenium, where for a given website I want the code to click the "get more departures" button. I have seen a similar question, however when I enter the "class" name in the the findelement function the result is that a button with the same class name higher on the page is clicked.
Could someone please help to click the "get more departures" button?
Would greatly appreciate any insight- as I am a beginner and got stuck here for hours!
Here is my current code which works for clicking the "Mars 12" button
library(RSelenium)
library(rvest)
rd <- rsDriver(browser = "firefox", port = 4478L)
ffd <- rd$client
ffd$navigate(paste0("https://www.flightsfrom.com/LAX/departures?durationFrom=21&durationTo=1071&dateMethod=day&dateFrom=2020-03-12&dateTo=2020-03-12",sep=""))
load_btn <- ffd$findElement(using = "css selector", ".button.md-raised.blue-md-button.md-primary.md-button.md-ink-ripple")
load_btn$clickElement()