I use RSelenium to navigate sites and interact with elements.
Question: using RSelenium, how can I view the list of options in the drop-down menu so that I can identify the last month and use this to set the drop-down menu to the correct value?
In a specific site, a drop-down menu is provided to the user to set the month of the year, thus defining the endpoint of the date range used in turn to display or download monthly data. As additional months of data become available throughout the year, options are in the drop-down list of changes.

6 , . , 4-6 , . 1 12 - , , .
, , ( , ), "7", , . , , X Y.
, Selenium -, , RSelenium.
- , .
library(RSelenium)
RSelenium::checkForServer()
RSelenium::startServer()
remDr <- remoteDriver(remoteServerAddr = "localhost",
port = 4444,
browserName = "firefox"
)
remDr <- remoteDriver()
Sys.sleep(5)
remDr$open()
remDr$getStatus()
remDr$navigate("http://jamaserv.jama.or.jp/newdb/eng/index.html")
frameElems <- remDr$findElements(using = "tag name", "frame")
sapply(frameElems, function(x){x$getElementAttribute("src")})
remDr$switchToFrame(frameElems[[1]])
webElem <- remDr$findElement(using = 'xpath', "//select[@name='txtTargetToMm']")
script <- paste0("arguments[0].value = '", 2, "'; arguments[0].onchange();")
remDr$executeScript(script, list(webElem))
webElem$getElementAttribute('value')