Examples of lookNode()


Examples of org.vietspider.html.path2.HTMLExtractor.lookNode()

          if(hyperlinkUtil == null) hyperlinkUtil = new HyperLinkUtil();
          HTMLNode header = null;
          HTMLNode body = null;
          try {
            NodePath nodePath  = pathParser.toPath("HEAD");
            header = extractor.lookNode(document.getRoot(), nodePath);
            nodePath  = pathParser.toPath("BODY");
            body = extractor.lookNode(document.getRoot(), nodePath);
          } catch (Exception e) {
            ClientLog.getInstance().setException(getShell(), e);
          }
View Full Code Here

Examples of org.vietspider.html.path2.HTMLExtractor.lookNode()

          HTMLNode body = null;
          try {
            NodePath nodePath  = pathParser.toPath("HEAD");
            header = extractor.lookNode(document.getRoot(), nodePath);
            nodePath  = pathParser.toPath("BODY");
            body = extractor.lookNode(document.getRoot(), nodePath);
          } catch (Exception e) {
            ClientLog.getInstance().setException(getShell(), e);
          }
         
          if(header == null || body == null) return;
View Full Code Here

Examples of org.vietspider.html.path2.HTMLExtractor.lookNode()

    HTMLExtractor extractor  = new HTMLExtractor();
    NodePathParser pathParser = new NodePathParser();
   
    try {
      NodePath nodePath  = pathParser.toPath(txt);
      HTMLNode node = extractor.lookNode(document.getRoot(), nodePath);
      if(node == null) return;
      if(node.isNode(Name.CONTENT)
          || node.isNode(Name.COMMENT)
          || node.isNode(Name.UNKNOWN)) {
        browser.setText(node.getTextValue());
View Full Code Here

Examples of org.vietspider.html.path2.HTMLExtractor.lookNode()

        browser.setText(node.getTextValue());
        return;
      }
     
      NodePath headerPath  = pathParser.toPath("HEAD");
      HTMLNode header = extractor.lookNode(document.getRoot(), headerPath);
   
      if(toolbar.isShowAll()) {
        if(hyperlinkUtil == null) hyperlinkUtil = new HyperLinkUtil();
        try {
          String address = toolbar.getText();
View Full Code Here

Examples of org.vietspider.html.path2.HTMLExtractor.lookNode()

//      builder.append("<base href=\""+baseHref+"\">");
      if(node.isNode(Name.BODY)) {
        HTMLNode body = null;
        try {
          nodePath  = pathParser.toPath("BODY");
          body = extractor.lookNode(document.getRoot(), nodePath);
        } catch (Exception e) {
          ClientLog.getInstance().setException(getShell(), e);
        }
       
        if(header == null || body == null) return;
View Full Code Here

Examples of org.vietspider.html.path2.HTMLExtractor.lookNode()

    for(TreeItem item : items) {
      String pathIndex = handler.getConfig(item);
      try {
        NodeInfoViewer viewer = new NodeInfoViewer(getShell(), x, y);
        NodePath nodePath = pathParser.toPath(pathIndex);
        HTMLNode node = extractor.lookNode(document.getRoot(), nodePath);
        viewer.setNode(node);  
        x += 10;
        y += 10;
        nodeViewers.add(viewer);
      } catch(Exception exp) {
View Full Code Here

Examples of org.vietspider.html.path2.HTMLExtractor.lookNode()

    HTMLExtractor extractor  = new HTMLExtractor();
    NodePathParser pathParser = new NodePathParser();
    String title = "title";
    try {
      NodePath nodePath  = pathParser.toPath("HEAD.TITLE");
      HTMLNode titleNode = extractor.lookNode(root, nodePath);
      if(titleNode.hasChildren()) {
        title  = titleNode.getChild(0).getTextValue();
      }
    } catch (Exception e) {
      return null;
View Full Code Here

Examples of org.vietspider.html.path2.HTMLExtractor.lookNode()

    HTMLDocument doc = new HTMLParser2().createDocument(tokens);
    NodePathParser pathParser = new NodePathParser();
    HTMLExtractor extractor  = new HTMLExtractor();
   
    NodePath nodePath  = pathParser.toPath("BODY");
    HTMLNode body = extractor.lookNode(doc.getRoot(), nodePath);
   
    TextRenderer renderer = new TextRenderer(body, TextRenderer.HANDLER);
    String value = renderer.getTextValue().toString();
    return value.trim().split("\n");
  }
View Full Code Here

Examples of org.vietspider.html.path2.HTMLExtractor.lookNode()

    HTMLExtractor extractor  = new HTMLExtractor();
    NodePathParser pathParser = new NodePathParser();

    NodePath nodePath  = pathParser.toPath("BODY");
    return extractor.lookNode(document.getRoot(), nodePath);
  }
 
  private ContentRenderer createContentRenderer(HTMLNode body) {
    List<HTMLNode> contents = searchNodes(body, Name.A);
   
View Full Code Here

Examples of org.vietspider.html.path2.HTMLExtractor.lookNode()

    HTMLExtractor extractor  = new HTMLExtractor();
    NodePathParser pathParser = new NodePathParser();

    NodePath nodePath  = pathParser.toPath("BODY");
    return extractor.lookNode(document.getRoot(), nodePath);
  }
 
}
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.