Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 为什么可以’;你按下这个按钮了吗?_R_Rselenium_Webautomation - Fatal编程技术网

R 为什么可以’;你按下这个按钮了吗?

R 为什么可以’;你按下这个按钮了吗?,r,rselenium,webautomation,R,Rselenium,Webautomation,我正在尝试使用RSelenium自动浏览一个站点,以便检索最新的计划发布日期。我的问题在于,当我访问URL时,会弹出一个年龄检查。页面(年龄检查页面)包含两个按钮,我还没有通过RSelenium成功点击它们。下面是我目前使用的代码,这个问题的解决方案是什么 #Varialble and URL s4 <- "https://www.systembolaget.se" #Start Server rd <- rsDriver() remDr <- rd[["client"]]

我正在尝试使用RSelenium自动浏览一个站点,以便检索最新的计划发布日期。我的问题在于,当我访问URL时,会弹出一个年龄检查。页面(年龄检查页面)包含两个按钮,我还没有通过RSelenium成功点击它们。下面是我目前使用的代码,这个问题的解决方案是什么

#Varialble and URL
s4 <- "https://www.systembolaget.se"

#Start Server
rd <- rsDriver()
remDr <- rd[["client"]]

#Load Page
remDr$navigate(s4)
webE <- remDr$findElements("class name", "action")
webE$isElementEnabled()
webE$clickElement()
#变量和URL

s4您需要更准确地定位选择器:

#Varialble and URL
s4 <- "https://www.systembolaget.se"

#Start Server
rd <- rsDriver()
remDr <- rd[["client"]]

#Load Page
remDr$navigate(s4)
webE <- remDr$findElement("css", "#modal-agecheck .action.primary")
webE$clickElement()
#变量和URL

非常感谢你,哈里森!