Package org.htmlparser.tags

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


      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

                    }
                } 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

      }
     
      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

      }
     
      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

        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

 
        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

        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

            NodeList all = parser.extractAllNodesThatMatch(infoCollector);

            if (all.size() >= 3) {
                int i=0;
                //get the icon
                ImageTag icon = (ImageTag)infoCollector.getNode(i++);
                item.setIconUrl(icon.getImageURL().replace("&&", "&"));

                //get the description
                NodeList list = infoCollector.getNodeList(i++);
                item.setSummary(NodeUtils.getTextData(list.elementAt(list.size()-1)));
               
View Full Code Here

                    });
            parser.extractAllNodesThatMatch(infoCollector);
           
          int i=0;
            //get the icon
            ImageTag icon = (ImageTag)infoCollector.getNode(i++);
            item.setIconUrl(icon.getImageURL());
           
            //strip off the query params
            int index = item.getIconUrl().indexOf('?');
            if (index != -1) {
                item.setIconUrl(item.getIconUrl().substring(0, index)+ "?wid=130&hei=182&cvt=jpeg");
View Full Code Here

TOP

Related Classes of org.htmlparser.tags.ImageTag

Copyright © 2018 www.massapicom. 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.