{
String htmlContents = IOUtils2.readString(htmlFile);
Lexer lexer = new Lexer(new Page(htmlContents));
Parser parser = new Parser(lexer, new DefaultParserFeedback(DefaultParserFeedback.QUIET));
TagFindingVisitor visitor = new TagFindingVisitor(new String[]{tagName});
parser.visitAllNodesWith(visitor);
tags = visitor.getTags(0);
}
// convert into List<TagNode>
List<TagNode> tagNodes = Lists.newArrayList();
CollectionUtils.addAll(tagNodes, tags);