-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.R
More file actions
18 lines (18 loc) · 697 Bytes
/
script.R
File metadata and controls
18 lines (18 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
library(RSelenium)
rD = rsDriver(browser = "firefox", check = F, verbose = F)
remDr = rD[["client"]]
remDr$navigate("https://web.whatsapp.com/")
Sys.sleep(30)
webElem = remDr$findElement(using = 'xpath', "//div[@title='Nova conversa']")$clickElement()
webElem = remDr$findElement(using = 'xpath', "//div[@contenteditable='true']")
webElem$sendKeysToElement(list("nome do contato"))
Sys.sleep(3)
webElem$sendKeysToElement(list(key = "enter"))
for (i in 1:length(txt.zap)) {
webElem = remDr$findElement(using = 'xpath', "//div[@spellcheck='true']")
webElem$sendKeysToElement(list(txt.zap[i]))
Sys.sleep(5)
webElem$sendKeysToElement(list(key = "enter"))
}
remDr$close()
rD[["server"]]$stop()