Rselenium, Chrome, How to Set Download Directory, File Download Error

RSelenium, Chrome, How to set download directory, file download error

I ran into this same problem and here's the solution that worked:

For some reason, you need to use double backslashes in the download.default_directory path, rather than single forward slashes.

So try this:

"download.default_directory" = "C:\\\XXX\\\YYY"

Instead of this:

"download.default_directory" = "C:/XXX/YYY"

Problem downloading file from a new tab with Rselenium

I was able to download the excel file by,

library(RSelenium)
driver <- rsDriver(browser = c("chrome"), port = 4341L)
remDr <- driver$client

# Select the dropdown menu,

remDr$findElement(using = "xpath",'//*[@id="ReportViewer1_ctl05_ctl04_ctl00"]') -> dropdown
dropdown$clickElement()

# Select the Excel file

remDr$findElement(using = "xpath",'//*[@id="ReportViewer1_ctl05_ctl04_ctl00_Menu"]/div[1]') -> exceldownload
exceldownload$clickElement()


Related Topics



Leave a reply



Submit