package jsynoptic.ui;
import org.htmlparser.Parser;
import org.htmlparser.util.ParserException;
import org.htmlparser.visitors.TextExtractingVisitor;
/**
* An implementation of {@link HTMLParser} using the external library Source Forge HTML Parser.
* @author zxpletran007
*
*/
public class SourceForgeHTMLParser implements HTMLParser{
/* (non-Javadoc)
* @see jsynoptic.ui.HTMLParser#extractText(java.lang.String)
*/
public String extractText(String htmlPath) {
String result = "";
try {
Parser parser = new Parser (htmlPath);
TextExtractingVisitor visitor = new TextExtractingVisitor ();
parser.visitAllNodesWith (visitor);
result = visitor.getExtractedText();
} catch (ParserException e1) {
}
return result;
}
}