Examples of extractAllNodesThatMatch()


Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

    Parser parser;
    NodeList list;
    List<String> versionsList = new ArrayList<String>();
    try {
      parser = new Parser (repositoryUrl);
      list = parser.extractAllNodesThatMatch(new NodeClassFilter(LinkTag.class));
    } catch (ParserException e) {
      System.err.println("Unable to read repository " + repositoryUrl);
      return null;
    }
   
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

    Parser parser;
    NodeList list;
    List<String> versionsList = new ArrayList<String>();
    try {
      parser = new Parser (url);
      list = parser.extractAllNodesThatMatch(new NodeClassFilter(LinkTag.class));
    } catch (ParserException e) {
      System.err.println("Unable to read repository " + url);
      return null;
    }
   
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

    if (baseUrl == null)
      return null;

    final HashSet<String> set = new HashSet<>();
    Parser parser = new Parser(html);
    NodeList matches = parser.extractAllNodesThatMatch(LINK_FILTER);
    SimpleNodeIterator it = matches.elements();
    while (it.hasMoreNodes()) {
      LinkTag node = (LinkTag) it.nextNode();
      String link = node.getLink().trim();
      // remove the anchor if present
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

   * @return never null, just an empty string if not parsable.
   */
  public static String extractTitle(String html) throws ParserException {
    String title = "";
    Parser parser = new Parser(html);
    NodeList matches = parser.extractAllNodesThatMatch(TITLE_FILTER);
    SimpleNodeIterator it = matches.elements();
    while (it.hasMoreNodes()) {
      TitleTag node = (TitleTag) it.nextNode();
      title = node.getTitle().trim();
    }
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

        final Parser htmlParser = initParser(html);
        final AndFilter filter = new AndFilter(new TagNameFilter(TABLE_TAG_NAME),
                new HasAttributeFilter(CLASS_ATTR_NAME, "details"));

        NodeList reportNode = htmlParser.extractAllNodesThatMatch(filter);
        if (reportNode != null && reportNode.size() > 0) {
            source = ((TableTag) reportNode.elements().nextNode()).toHtml(true);
        }

        return source;
View Full Code Here

Examples of org.htmlparser.Parser.extractAllNodesThatMatch()

        if (content == null || content.length == 0) {
            return null;
        }
        Parser parser = Parser.createParser(new String(content), null);
        try {
            NodeList nodelist = parser.extractAllNodesThatMatch(new NodeFilter() {
    public boolean accept(Node node) {
                    return true;
                }
            });
            return nodelist;
View Full Code Here

Examples of org.htmlparser.util.NodeList.extractAllNodesThatMatch()

        ret = mParser.parse (null);
        filters = getFilters ();
        if (null != filters)
            for (int i = 0; i < filters.length; i++)
                ret = ret.extractAllNodesThatMatch (filters[i], mRecursive);

        return (ret);
    }

    /**
 
View Full Code Here

Examples of org.htmlparser.util.NodeList.extractAllNodesThatMatch()

                            new IsEqualFilter (this)),
                        new AndFilter ( // recurse up the parent chain
                            new NotFilter (cls), // but not past the first table
                            recursion));
            recursion.setParentFilter (filter);
            kids = kids.extractAllNodesThatMatch (
                // it's a row, and has this table as it's enclosing table
                new AndFilter (
                    new NodeClassFilter (TableRow.class),
                    filter), true);
            ret = new TableRow[kids.size ()];
View Full Code Here

Examples of org.htmlparser.util.NodeList.extractAllNodesThatMatch()

                            new IsEqualFilter (this)),
                        new AndFilter ( // recurse up the parent chain
                            new NotFilter (cls), // but not past the first row
                            recursion));
            recursion.setParentFilter (filter);
            kids = kids.extractAllNodesThatMatch (
                // it's a column, and has this row as it's enclosing row
                new AndFilter (
                    new NodeClassFilter (TableColumn.class),
                    filter), true);
            ret = new TableColumn[kids.size ()];
View Full Code Here

Examples of org.htmlparser.util.NodeList.extractAllNodesThatMatch()

                            new IsEqualFilter (this)),
                        new AndFilter ( // recurse up the parent chain
                            new NotFilter (cls), // but not past the first row
                            recursion));
            recursion.setParentFilter (filter);
            kids = kids.extractAllNodesThatMatch (
                // it's a header, and has this row as it's enclosing row
                new AndFilter (
                    new NodeClassFilter (TableHeader.class),
                    filter), true);
            ret = new TableHeader[kids.size ()];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.