Examples of ImageTag


Examples of org.htmlparser.tags.ImageTag

        parseAndAssertNodeCount(1);
        // The node should be an HTMLImageTag
        assertTrue(
            "Node should be a HTMLImageTag",
            node[0] instanceof ImageTag);
        ImageTag imageTag = (ImageTag) node[0];
        assertStringEquals(
            "The image locn",
            "<IMG WIDTH=\"305\" ALT=\"Google\" SRC=\"../../goo/title_homepage4.gif\" HEIGHT=\"115\">",
            imageTag.toHtml());
        assertEquals("Alt", "Google", imageTag.getAttribute("alt"));
        assertEquals("Height", "115", imageTag.getAttribute("height"));
        assertEquals("Width", "305", imageTag.getAttribute("width"));
    }
View Full Code Here

Examples of org.htmlparser.tags.ImageTag

                    }
                } catch (MalformedURLException e1) {
                    throw new HTMLParseException(e1);
                }
            } else if (tag instanceof ImageTag) {
                ImageTag image = (ImageTag) tag;
                binUrlStr = image.getImageURL();
            } else if (tag instanceof AppletTag) {
                // look for applets

                // This will only work with an Applet .class file.
                // Ideally, this should be upgraded to work with Objects (IE)
View Full Code Here

Examples of org.htmlparser.tags.ImageTag

                    }
                } catch (MalformedURLException e1) {
                    throw new HTMLParseException(e1);
                }
            } else if (tag instanceof ImageTag) {
                ImageTag image = (ImageTag) tag;
                binUrlStr = image.getImageURL();
            } else if (tag instanceof AppletTag) {
            // look for applets

            // This will only work with an Applet .class file.
            // Ideally, this should be upgraded to work with Objects (IE)
            // and archives (.jar and .zip) files as well.
                AppletTag applet = (AppletTag) tag;
                binUrlStr = applet.getAppletClass();
            } else if (tag instanceof InputTag) {
                // we check the input tag type for image
                if (ATT_IS_IMAGE.equalsIgnoreCase(tag.getAttribute(ATT_TYPE))) {
                    // then we need to download the binary
                    binUrlStr = tag.getAttribute(ATT_SRC);
                }
            } else if (tag instanceof LinkTag) {
                LinkTag link = (LinkTag) tag;
                if (link.getChild(0) instanceof ImageTag) {
                    ImageTag img = (ImageTag) link.getChild(0);
                    binUrlStr = img.getImageURL();
                }
            } else if (tag instanceof ScriptTag) {
                binUrlStr = tag.getAttribute(ATT_SRC);
            } else if (tag instanceof FrameTag) {
                binUrlStr = tag.getAttribute(ATT_SRC);
View Full Code Here

Examples of org.htmlparser.tags.ImageTag

                    }
                } catch (MalformedURLException e1) {
                    throw new HTMLParseException(e1);
                }
            } else if (tag instanceof ImageTag) {
                ImageTag image = (ImageTag) tag;
                binUrlStr = image.getImageURL();
            } else if (tag instanceof AppletTag) {
                // look for applets

                // This will only work with an Applet .class file.
                // Ideally, this should be upgraded to work with Objects (IE)
View Full Code Here

Examples of org.htmlparser.tags.ImageTag

      NodeList list = parser.extractAllNodesThatMatch(filter);
      SimpleNodeIterator simpleNodeIterator = list.elements();
      while (simpleNodeIterator.hasMoreNodes()) {
         Node node = simpleNodeIterator.nextNode();
         if (node instanceof ImageTag) {
            ImageTag img = (ImageTag) node;
            String attribute = img.getAttribute("src");
            String decoded = EncoderUtil.decode(attribute);

            if (decoded != null) {
               int position = decoded.indexOf("/" + String.valueOf(bingoIdx));
               if (position != -1) {
View Full Code Here

Examples of org.htmlparser.tags.ImageTag

                    }
                } catch (MalformedURLException e1) {
                    throw new HTMLParseException(e1);
                }
            } else if (tag instanceof ImageTag) {
                ImageTag image = (ImageTag) tag;
                binUrlStr = image.getImageURL();
            } else if (tag instanceof AppletTag) {
                // look for applets

                // This will only work with an Applet .class file.
                // Ideally, this should be upgraded to work with Objects (IE)
                // and archives (.jar and .zip) files as well.
                AppletTag applet = (AppletTag) tag;
                binUrlStr = applet.getAppletClass();
            } else if (tag instanceof InputTag) {
                // we check the input tag type for image
                if (ATT_IS_IMAGE.equalsIgnoreCase(tag.getAttribute(ATT_TYPE))) {
                    // then we need to download the binary
                    binUrlStr = tag.getAttribute(ATT_SRC);
                }
            } else if (tag instanceof LinkTag) {
                LinkTag link = (LinkTag) tag;
                if (link.getChild(0) instanceof ImageTag) {
                    ImageTag img = (ImageTag) link.getChild(0);
                    binUrlStr = img.getImageURL();
                }
            } else if (tag instanceof ScriptTag) {
                binUrlStr = tag.getAttribute(ATT_SRC);
            } else if (tag instanceof FrameTag) {
                binUrlStr = tag.getAttribute(ATT_SRC);
View Full Code Here

Examples of org.htmlparser.tags.ImageTag

      }
     
      String title = titleLink.getLinkText();

      int rating = -1;
      ImageTag ratingNode = (ImageTag)infoCollector.getNode(i++);
      if (ratingNode != null) {
        String ratingStr = ratingNode.getImageURL();
        matcher = ratingPattern.matcher(ratingStr);
        if (matcher.matches()) {
          rating = Integer.parseInt(matcher.group(1));
        }
      }
View Full Code Here

Examples of org.htmlparser.tags.ImageTag

      }
     
      String title = titleLink.getLinkText();

      int rating = -1;
      ImageTag ratingNode = (ImageTag)infoCollector.getNode(i++);
      if (ratingNode != null) {
        String ratingStr = ratingNode.getImageURL();
        matcher = ratingPattern.matcher(ratingStr);
        if (matcher.matches()) {
          rating = Integer.parseInt(matcher.group(1));
        }
      }
View Full Code Here

Examples of org.htmlparser.tags.ImageTag

        year = year.replaceAll("\\((\\d*)\\)", "$1");
 
        String mpaa = NodeUtils.getTextData(infoCollector.getNode(i++));
 
        int rating = -1;
        ImageTag ratingNode = (ImageTag)infoCollector.getNode(i++);
        if (ratingNode != null) {
          String ratingStr = ratingNode.getImageURL();
          matcher = ratingPattern.matcher(ratingStr);
          if (matcher.matches()) {
            rating = Integer.parseInt(matcher.group(1));
          }
        }
View Full Code Here

Examples of org.htmlparser.tags.ImageTag

 
        String year = NodeUtils.getTextData(infoCollector.getNode(i++));
        year = year.replaceAll("\\((\\d*)\\)", "$1");
 
        int rating = -1;
        ImageTag ratingNode = (ImageTag)infoCollector.getNode(i++);
        if (ratingNode != null) {
          String ratingStr = ratingNode.getImageURL();
          matcher = ratingPattern.matcher(ratingStr);
          if (matcher.matches()) {
            rating = Integer.parseInt(matcher.group(1));
          }
        }
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.