public static HTMLDocument getHTMLDocument(String url) { try { Reader stringReader = new StringReader(getResponse(url)); HTMLEditorKit htmlKit = new HTMLEditorKit(); HTMLDocument htmlDoc = (HTMLDocument) htmlKit.createDefaultDocument(); Parser parser = new ParserDelegator(); parser.parse(stringReader, htmlDoc.getReader(0), true); return htmlDoc; } catch(Exception e) { e.printStackTrace(); } return null; }
public void setParser(final HTMLEditorKit.Parser parser) { this.parser = parser; }
public HTMLEditorKit.Parser getParser() { return parser; }