Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can’t RSelenium press this button?

I’m trying to automate browsing on a site with RSelenium in order to retrieve the latest planned release dates. My problem lies in that there is an age-check that pops up when I visit the URL. The page(age-check-page) concists of two buttons, which I haven’t succeeded to click on through RSelenium. The code that I use thus far is appended below, what is the solution for this problem?

#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()
like image 918
Allan A Avatar asked Jan 19 '26 13:01

Allan A


1 Answers

You need to more accurately target the selector:

#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()
like image 186
jdharrison Avatar answered Jan 21 '26 05:01

jdharrison



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!