I'm trying to scrape this Website using RSelenium. Sending text to other elements works but the login field drives me nuts. I think it might be because it is in Java (at least the css selectors in SelectorGadget say .j_username & .j_password) but I can't seem to figure out how to deal with it.
I wouldn't mind logging in manually but I also can't figure out how that works =).
remDr <- RSelenium::remoteDriver(remoteServerAddr = "localhost",
port = 4445L,
browserName = "chrome")
remDr$open()
remDr$navigate("https://smd.ch/SMDView/log/index.jsp")
login_name <- remDr$findElement(using = "xpath", "//*[contains(concat( ' ', @class, ' ' ), concat( ' ', 'j_username', ' ' ))]")
login_name$clickElement()
login_name$clearElement()
login_name$clickElement()
login_name$sendKeysToElement(list("xxxxxxx"))
login_pw <- remDr$findElement(using = "xpath", "//*[contains(concat( ' ', @class, ' ' ), concat( ' ', 'j_password', ' ' ))]")
login_pw$click()
login_pw$clearElement()
login_name$click()
login_pw$sendKeysToElement(list("xxxxxxx", "\uE007"))
remDr$screenshot(display = TRUE)