Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sendkeys element using R programming?

I have tried to sendkeysElement using R programming. Here is my code

require(RSelenium)
remdir<-remoteDriver()
remdir$open()

remdir$navigate("http://www.flipkart.com")
sbox<-remdr$findElement(using = 'name',"q")

sbox$sendkeysToElement(list("laptops",key="enter"))

But I got the error like this

Error in checkError(res) : 
Undefined error in httr call. httr output: length(url) == 1 is not TRUE
like image 527
Suganthan Raj Avatar asked Jan 20 '26 03:01

Suganthan Raj


1 Answers

You have a number of typo's which maybe an issue. The code works with chrome:

require(RSelenium)
rD <- rsDriver()
remdir<- rD$client
remdir$open()

remdir$navigate("http://www.flipkart.com")
sbox <- remdir$findElement(using = 'name',"q")

sbox$sendKeysToElement(list("laptops",key="enter"))
rm(rD)
gc()
like image 98
jdharrison Avatar answered Jan 22 '26 23: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!