Java
Chilkat2 Java
Example to Download Web Page as MHT Archive
See more MHT / HTML Email Examples
Demonstrates how to download a web page into a .mht web archive.Chilkat Java Downloads
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Mht;
public class ChilkatExample {
public static void main(String[] args) {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Mht mht = new Mht();
try {
mht.getAndSaveMHT("http://www.piscatur.com/", "qa_data/mht/piscatur.mht");
System.out.println("MHT Created!");
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
return;
}
}
}