0

I want to use GET() function from httr package, because this is just an example file and in the original file I need to write in user name and password i.e.

library(httr)
filename<-"filename_in_url.xls"
URL <- "originalurl"
GET(URL, authenticate("usr", "pwd"), write_disk(paste0("C:/Temp/temp/",filename), overwrite = TRUE))

As a test, I tried to import one of the files from I want to import one of the files from https://www.nordpoolgroup.com/historical-market-data/ and do not save it to the disk, but save it to the environment in order to see the data. However, it also does not work.

library(XML)
library(RCurl)

excel <- readHTMLTable(htmlTreeParse(getURL(paste("https://www.nordpoolgroup.com/4a4c6b/globalassets/marketdata-excel-files/elspot-prices_2021_hourly_eur.xls")), useInternalNodes=TRUE))[[1]]

Or if there are other ways how to import data (functions where login information can be as an input)m it will be great to see them

Priit Mets
  • 465
  • 2
  • 14
  • It would help to add the error code or explain more what you mean by "it does not work"? – mikebader Sep 03 '21 at 15:54
  • Have you tried the solution here? https://stackoverflow.com/questions/57788784/reading-excel-file-into-r-using-readxl-and-httr-libxls-error-unable-to-open-fil – mikebader Sep 03 '21 at 16:01
  • Does this answer your question? [Reading Excel file into R using readxl and httr/libxls error: Unable to open file](https://stackoverflow.com/questions/57788784/reading-excel-file-into-r-using-readxl-and-httr-libxls-error-unable-to-open-fil) – mikebader Sep 03 '21 at 16:01

0 Answers0