My script below interacts with a Japanese geolocation website, successfully accesses a new page, but encounters issues locating and clicking on a specific link using RSelenium.
library(XML)
library(RSelenium)
remDr <- remoteDriver(
remoteServerAddr = "localhost",
port = 4445L,
browserName = "firefox"
)
remDr$open()
remDr$navigate("https://maps.gsi.go.jp")
remDr$screenshot(display = TRUE)
remDr$getCurrentUrl()
webElem <- remDr$findElement(using = "id", value = "query")
webElem$getElementAttribute("id")
webElem$highlightElement()
webElem$sendKeysToElement(list("茨城県行方郡玉造町","\uE007"))
remDr$screenshot(display = TRUE)
I'm aiming to click on the node displayed below in order to extract the URL from the subsequent page. However, all my strategies involving remDr$findElement
have proven ineffective. Could there be an essential step or approach that I am overlooking?
<a href="javascript:void(0);" style="padding-left: 32px; background: url("image/mapicon/search_result.png") 0px 50% no-repeat;"><div class="title">茨城県行方郡</div><div class="muni">茨城県行方市</div></a>