2
I have a method that generates an Htmlpage, I would like to save to disk.
public void gerarPaginaIndex() {
try {
final HtmlPage paginaIndex = WebClientFactory.getInstance().getPage(URL_INICIAL);
this.criarPaginaEmDisco(paginaIndex, new File(PATH + "paginaIndex.html"));
} catch (IOException e) {
e.printStackTrace();
}
}
The method creatPaginaEmDisco() receives by parameter the address to save and Htmlpage.
That’s cool! But there’s a way not to save images and other files?
– laaf
To save only html it is better to save in the file the return of .toString(), or html bytes, as commented below.
– Andre Gusmao