Lufy
Lufy

Reputation: 175

Enter text in popup box using Rselenium

I'm trying to pull data from glassdoor website using Rselenium. I'm unable to enter email id and password in the popup window. This is my code. I'm not sure where I'm going wrong. When I try to highlight email box, sign in button is being highlighted.

remDr$navigate("https://www.glassdoor.com")
webElem <- remDr$findElement("class", "sign-in")
webElem$highlightElement()
webElem$clickElement()
email <- webElem$findElement(using = "name", "username")
email$highlightElement()
email$sendKeysToElement(list("EMAIL ID")) -->Throwing Error

Upvotes: 2

Views: 1349

Answers (1)

jdharrison
jdharrison

Reputation: 30425

The following works with latest chrome:

library(RSelenium)

rD <- rsDriver()
remDr <- rD$client

remDr$navigate("https://www.glassdoor.com")
webElem <- remDr$findElement("class", "sign-in")
webElem$highlightElement()
webElem$clickElement()
remDr$setImplicitWaitTimeout()
email <- remDr$findElement(using = "id", "signInUsername")
email$sendKeysToElement(list("EMAIL ID"))

....

rm(rD)
gc()

Upvotes: 1

Related Questions