2

I am trying to load a local html file which I have downloaded. Does anybody know how to do this? I am currently getting statuscode[404].

this is how I am doing it

HtmlPage htmlPage=webClient.getPage("file:\\\\Users\\njd202\\Desktop\\zipmeupbich\\springbootmongodb\\src\\main\\resources\\downloadedfiles\\Cuban2.html") ;

1 Answers1

5

Have done a short test here and it works fine for me.

webClient.getPage("file:\\\\C:\\Users\\me\\Desktop\\htmlunit\\test.html"

Please check if you are

  • using the latest HtmlUnit version
  • using the right path
  • start with a file with really simple html content (no external links/references)
RBRi
  • 2,704
  • 2
  • 11
  • 14