RSelenium:无法将输入发送到文本框
RSelenium: failing to send input to text box
此脚本完全独立于经度和纬度字段中的输入文本工作,由于某些原因这些字段没有响应。你能帮忙弄清楚如何解决这个问题吗?
library(RSelenium)
library(tidyverse)
driver <- rsDriver(browser = c("chrome"), chromever = "78.0.3904.105")
remote_driver <- driver[["client"]]
remote_driver$open()
remote_driver$navigate("https://climateknowledgeportal.worldbank.org/download-data#download-data-projections-tab")
type_element <- remote_driver$findElement(using = 'id', value = 'futureType')
variable <- remote_driver$findElement(using = 'id', value = 'variablesFutu')
longitude <- remote_driver$findElement(using = 'class', value = 'longitude')
latitude <- remote_driver$findElement(using = 'id', value = 'latitude')
time_period <- remote_driver$findElement(using = 'id', value = 'futuTimeSeries')
statistic <- remote_driver$findElement(using = 'id', value = 'statistic')
scenario <- remote_driver$findElement(using = 'id', value = 'scenario')
type_element$sendKeysToElement(list("CMIP5"))
variable$sendKeysToElement(list("cdd65"))
time_period$sendKeysToElement(list("2040-2059"))
statistic$sendKeysToElement(list("manom"))
scenario$sendKeysToElement(list("rcp45"))
latitude$sendKeysToElement(list("30")) # does not work
longitude$sendKeysToElement(list("30")) # does not work
button_element <- remote_driver$findElement(using = 'id', value = "downloadProjectionsBtn")
button_element$clickElement()
不是 RSelenium 专家,但我看到您将纬度标识为
latitude <- remote_driver$findElement(using = 'id', value = 'latitude')
,当 id 实际上是 latitudeProj
除了纬度和经度,你的所有字段都是列表,但你似乎将这两个字段作为列表项发送给它们?如果你试试:
latitude$sendKeysToElement("abc")
会接受吗?
此脚本完全独立于经度和纬度字段中的输入文本工作,由于某些原因这些字段没有响应。你能帮忙弄清楚如何解决这个问题吗?
library(RSelenium)
library(tidyverse)
driver <- rsDriver(browser = c("chrome"), chromever = "78.0.3904.105")
remote_driver <- driver[["client"]]
remote_driver$open()
remote_driver$navigate("https://climateknowledgeportal.worldbank.org/download-data#download-data-projections-tab")
type_element <- remote_driver$findElement(using = 'id', value = 'futureType')
variable <- remote_driver$findElement(using = 'id', value = 'variablesFutu')
longitude <- remote_driver$findElement(using = 'class', value = 'longitude')
latitude <- remote_driver$findElement(using = 'id', value = 'latitude')
time_period <- remote_driver$findElement(using = 'id', value = 'futuTimeSeries')
statistic <- remote_driver$findElement(using = 'id', value = 'statistic')
scenario <- remote_driver$findElement(using = 'id', value = 'scenario')
type_element$sendKeysToElement(list("CMIP5"))
variable$sendKeysToElement(list("cdd65"))
time_period$sendKeysToElement(list("2040-2059"))
statistic$sendKeysToElement(list("manom"))
scenario$sendKeysToElement(list("rcp45"))
latitude$sendKeysToElement(list("30")) # does not work
longitude$sendKeysToElement(list("30")) # does not work
button_element <- remote_driver$findElement(using = 'id', value = "downloadProjectionsBtn")
button_element$clickElement()
不是 RSelenium 专家,但我看到您将纬度标识为
latitude <- remote_driver$findElement(using = 'id', value = 'latitude')
,当 id 实际上是 latitudeProj
除了纬度和经度,你的所有字段都是列表,但你似乎将这两个字段作为列表项发送给它们?如果你试试:
latitude$sendKeysToElement("abc")
会接受吗?