# NOT RUN {
# }
# NOT RUN {
#This function is based on web browser automation, so, before start,
make sure you have successfully installed web driver (phantomjs).
install_browser()
# Run browser process and get its reference object
br<- run_browser()
brs<-LoginSession(Browser = br, LoginURL = 'http://glofile.com/wp-login.php',
LoginCredentials = c('demo','rc@pass@r'),
cssLoginFields =c('#user_login', '#user_pass'),
cssLoginButton='#wp-submit' )
# To make sure that you have been successfully authenticated
# Check URL of the current page after login redirection
brs$getUrl()
# Or Take screenshot of the website dashborad
brs$takeScreenshot(file = "sc.png")
brs$delete()
brs$status()
brs$go(url)
brs$getUrl()
brs$goBack()
brs$goForward()
brs$refresh()
brs$getTitle()
brs$getSource()
brs$takeScreenshot(file = NULL)
brs$findElement(css = NULL, linkText = NULL,
partialLinkText = NULL, xpath = NULL)
brs$findElements(css = NULL, linkText = NULL,
partialLinkText = NULL, xpath = NULL)
brs$executeScript(script, ...)
brs$executeScriptAsync(script, ...)
brs$setTimeout(script = NULL, pageLoad = NULL, implicit = NULL)
brs$moveMouseTo(xoffset = 0, yoffset = 0)
brs$click(button = c("left", "middle", "right"))
brs$doubleClick(button = c("left", "middle", "right"))
brs$mouseButtonDown(button = c("left", "middle", "right"))
brs$mouseButtonUp(button = c("left", "middle", "right"))
brs$readLog(type = c("browser", "har"))
brs$getLogTypes()
# }
Run the code above in your browser using DataLab