ropensci / RSelenium

An R client for Selenium Remote WebDriver
https://docs.ropensci.org/RSelenium
342 stars 81 forks source link

Can't launch browser through RStudio's taskscheduler #178

Open akalamoyo opened 6 years ago

akalamoyo commented 6 years ago

I'm trying to crawl data from a website using RSelenium. The script below runs perfectly in RStudio (R version 3.5.0) with no issues.

Code library(RSelenium) library(rvest) library(xlsx) library(XML) library(RODBC) library(taskscheduleR) library(DBI) library(odbc)

con <- dbConnect(odbc::odbc(), .connection_string = "Driver={ODBC Driver 11 for SQL Server};server=HG-SOS-MI;database=Data_Testing;trusted_connection=yes")

driver<- rsDriver() browser <- driver[["client"]] browser$navigate("www.nigerianstat.gov.ng/elibrary") browser$maxWindowSize()

However, when I schedule it (for a routine task) using the built-in taskScheduleR addin, I get the following in the error log:

Error Log Loading required package: methods Warning message: package 'DBI' was built under R version 3.4.4 Loading required package: xml2 Loading required package: rJava Loading required package: xlsxjars Warning messages: 1: package 'xlsx' was built under R version 3.4.3 2: package 'rJava' was built under R version 3.4.3

Attaching package: 'XML'

The following object is masked from 'package:rvest':

xml

Warning message: package 'taskscheduleR' was built under R version 3.4.3 checking Selenium Server versions: BEGIN: PREDOWNLOAD BEGIN: DOWNLOAD BEGIN: POSTDOWNLOAD checking chromedriver versions: BEGIN: PREDOWNLOAD BEGIN: DOWNLOAD BEGIN: POSTDOWNLOAD checking geckodriver versions: BEGIN: PREDOWNLOAD BEGIN: DOWNLOAD BEGIN: POSTDOWNLOAD checking phantomjs versions: BEGIN: PREDOWNLOAD BEGIN: DOWNLOAD BEGIN: POSTDOWNLOAD

Error in subprocess::spawn_process(tfile, ...) : could not create process: Access is denied Calls: rsDriver ... spawn_tofile -> windows_spawn_tofile -> -> .Call Execution halted

alanmcknight commented 5 years ago

Hello,

Did you find a solution to this? I am also trying to find an answer.

Thanks.

akalamoyo commented 5 years ago

Not yet, it still persists.

On Thu, 23 Aug 2018, 11:33 Alan, notifications@github.com wrote:

Hello,

Did you find a solution to this? I am also trying to find an answer.

Thanks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ropensci/RSelenium/issues/178#issuecomment-415353923, or mute the thread https://github.com/notifications/unsubscribe-auth/AY9paSShXsx23zctTNwgPPRqXkEPYykpks5uTnbrgaJpZM4U2PCj .

javierasensio commented 4 years ago

Hello, This is now an old thread, but I have the same problem with taskscheduleR and RSelenium. Have you found any solutions? Thanks