'RSelenium: How to click on checkbox
I was wondering whether someone could help me out with the following issue: For a research project, I have to collect addresses of bank branches. On this site, the locations include ATMs (Bankomati) as well as branches. Deselecting the checkbox on ATMs provides the addresses I am interested in.
With the code below, I am able to load the page and check the status of the checkbox (isElementSelected). However, I can't change the checkbox (using clickElement). I think I use the correct DOM "id", since the result of isElementSelected changes when I manually click on the checkbox.
In short, how can I click on the checkbox via RSelenium? Below my code. Many thanks.
library(tidyverse)
link_to_address <- "https://sberbankbl.ba/point/pointlist"
library(RSelenium)
rD <- rsDriver(browser="chrome", port=4541L, verbose=F)
remDr <- rD[["client"]]
remDr$navigate(link_to_address)
Sys.sleep(5)
webElem <- remDr$findElement(using = 'id',
value = 'atmCheckbox')
webElem$isElementSelected()
webElem$clickElement()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
