Re: [Htmlparser-user] Bug in HTMLFrameTag ?
Brought to you by:
derrickoswald
From: Elodie T. <et...@in...> - 2003-02-05 14:36:23
|
I answer to myself ;o) I think I've found the source of my problem. I've added : parser.addScanner( new HTMLFrameSetScanner() ); parser.addScanner( new HTMLFrameScanner() ); to my code, and it seems to work now. But I've discored another problem : if there is one or many <frameset> tags included in a <frameset>, they are not detected (only the <frame> tags). Could someone confirm me that, or I'm totally wrong ? Thanx. > Hi, > > I want to modify attributes of some HTMLTags that I get. I'm using the following code just to see how the parser works. The problem is that it doesn't detect the <frame> tags, although it gets the other tags (a, img, frameset). I tested it with a HTML document that have 2 or 3 frame tags, and it sees none of them ! > > What can I do ? > > Thanx in advance for your help. > > > > HTMLReader htmlReader = new HTMLReader ( buffer, len ); > HTMLParser parser = new HTMLParser(htmlReader); > parser.registerScanners(); > > HTMLEnumeration e = parser.elements(); > while ( e.hasMoreNodes() ) { > > HTMLNode node = e.nextHTMLNode(); > > if ( node instanceof HTMLLinkTag) { > logger.debug ( " href = " + ((HTMLLinkTag) node).getLink() ); > } else { > if ( node instanceof HTMLImageTag) { > logger.debug ( " srcImg = " + ((HTMLImageTag) node).getImageURL() ); > } else { > if ( node instanceof HTMLFrameSetTag) { > logger.debug ( " srcFrameSet = " + ((HTMLFrameSetTag) node).getFrameLocation() ); > } else { > if ( node instanceof HTMLFrameTag) { > logger.debug ( " srcFrame = " + ((HTMLFrameSetTag) node).getFrameLocation() ); > } else { > if ( node instanceof HTMLTag) > logger.debug ( " HTMLTag = " + ( (HTMLTag) node).toHTML() ); > } > } > } > } > } > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > |