我想保存网页JavaFX
,我写了这段代码,这段代码只保存网页,html
但我需要同一页。CSS
JavaScript
SampleController sp=new SampleController();
WebEngine webEngine =sp.web.getEngine();
webEngine.load(sp.url.getText());
OutputStream out = new FileOutputStream(
txtFileURL.getText() +"/"+txtname+".htm"
);
out.write(
((String) webEngine.executeScript(
"document.documentElement.innerHTML"
)).getBytes()
);
out.flush();
out.close();