3
我想從此National River Flow Archive(UK)網站獲取年度最大流量數據: http://nrfa.ceh.ac.uk/data/station/info/69032 使用RSelenium。 我無法找到協商下拉菜單的方法。目前使用我可以半自動化的過程:使用RSelenium從網頁表中檢索數據
library(RSelenium)
checkForServer()
startServer()
remDr <- remoteDriver(remoteServerAddr = "localhost", port = 4444, browserName = "firefox", platform = "LINUX")
remDr$open()
i <- "69032"
remDr$navigate(paste0("http://nrfa.ceh.ac.uk/data/station/peakflow/", i))
# read the raw html and parse
doc<-htmlParse(remDr$getPageSource()[[1]])
peak.flows <- as.numeric(readHTMLTable(doc)$tablesorter[, "Flow (m3/s)"])
這是一個黑客位,並涉及到了我要點擊頁面上的幾個按鈕,而不是讓RSelenium做到這一點。有關RSelenium如何從下拉菜單中選擇「峯值流量數據」選項卡,然後選擇「最大年度(AMAX)數據」選項的任何建議?