I am writing a java project using the HTMLCleaner library and save the output as a XML file this is the code that I wrote :
URL urlSB = new URL("http://www.groupon.com/browse/chicago?z=skip");
URLConnection urlConnection = urlSB.openConnection();
urlConnection.addRequestProperty("User-Agent", "google.com");
urlConnection.connect();
HtmlCleaner cleaner = new HtmlCleaner();
CleanerProperties props = cleaner.getProperties();
props.setNamespacesAware(false);
TagNode tagNodeRoot = cleaner.clean(urlConnection.getInputStream());
// serialize to xml file
new PrettyXmlSerializer(props).writeToFile(
tagNodeRoot , "cleaned.xml", "utf-8"
);
The problem is that after running the project, cleaned.xml file is empty.