import java.io.*; //used to access the FileOutputStream,InputStream,and OutputStream class import java.net.*; // used to access the URL class import javax.swing.text.html.parser.DTD; //this library parses an html file to become a document
try { OutputStream out = new FileOutputStream("source.html"); //filename of the html file after downloading
in.close(); // close the InputStream out.flush(); //flush the OutputStream out.close(); //close the OutputStream
import java.io.*; //used to access the FileOutputStream,InputStream,and OutputStream class import java.net.*; // used to access the URL class import javax.swing.text.html.parser.DTD; //this library parses an html file to become a document public class saveWebPage{ try { OutputStream out = new FileOutputStream("source.html"); //filename of the html file after downloading in.close(); // close the InputStream out.flush(); //flush the OutputStream out.close(); //close the OutputStream } } } }