Created
April 6, 2016 13:13
-
-
Save StevenMMortimer/90b7db0f4e515337f50e6a92fe152ac1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RSelenium) | |
appURL <- "XXXXXX.com" | |
username <- "myusername" | |
password <- "mypassword" | |
RSelenium::startServer() | |
library(RSelenium) | |
RSelenium::startServer() | |
pJS <- phantom(pjs_cmd='path/to/phantomjs', | |
extras=c("--ssl-protocol=any")) | |
Sys.sleep(5) # give the binary a moment | |
eCap <- list(phantomjs.page.settings.userAgent | |
= "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20120101 Firefox/29.0") | |
remDr <- remoteDriver(browserName = "phantomjs", extraCapabilities = eCap) | |
Sys.sleep(5) # give the binary a moment | |
remDr$open() | |
Sys.sleep(5) # give the binary a moment | |
#pJS$stop() | |
remDr$navigate(appURL) | |
remDr$getPageSource() | |
userName <- remDr$findElement("id", "username") | |
userName$sendKeysToElement(list(username)) | |
passWord <- remDr$findElement("id", "passwordword") | |
passWord$sendKeysToElement(list(password)) | |
logIn <- remDr$findElement("id", "LoginButton") | |
logIn$clickElement() | |
remDr$navigate('xxxx') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment