0

I'm having a hard time loading a local HTML file. I tried with xml2 and it gives an empty file. With htmltools and its function includeHTML I get an error message.

library(htmltools)

rawHTML<-includeHTML("C:/Users/grouetl/Documents/ProjetsLISE/Camille/Corpusgetz.html")

I get this error message :

Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open file 'C:/Users/grouetl/Documents/ProjetsLISE/Camille/Corpusgetz.html': No such file or directory

I tried various version of relative path (after having set the wd) but I always get the same result.. Thank you for any advice

2
  • There is a typo in your code. It should be .html instead of .hmtl Commented May 3, 2023 at 9:06
  • I'm not familiar with R, but have you tried double slashes? c:// or `c:\` and so on...
    – pierpy
    Commented May 3, 2023 at 18:45

1 Answer 1

0

the problem was solved simply by changing the extension of the file from "file.html" to "file.HTML" !

Not the answer you're looking for? Browse other questions tagged or ask your own question.