#! /usr/bin/Rscript
library(RSelenium)
library(seleniumPipes)
library(foreach)
library(iterators)
library(purrr)
library(dplyr)
library(glue)
library(jsonlite)
library(stringr)
library(curlR)
# "java -jar selenium-server-standalone-3.141.59.jar"
# setwd("..")
source("examples/WK_pkgs.R")
# devtools::load_all()
prefs <- list("permissions.default.image", 2L)
cprof <- list(firefox_profile = list(prefs = prefs))
user <- list(name = "410721198205023517", pwd = "023517")
# write_json(user, "wk_user.json")
# user <- read_json("wk_user.json")
p <- NULL
for (i in 1:10) {
tryCatch(
{
port <- 4444
kill_selenium(port)
p <<- init_selenium(port, browserName = "firefox")
# p$open(); #p$maxWindowSize()
wk_login(p, user$name[[1]], user$pwd[[1]])
wk_listener(p, skip_finished = TRUE)
},
error = function(e) {
wk_listener(p, skip_finished = TRUE)
message(sprintf("%s", e$message))
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.