[Htmlparser-user] HTML tree creation
Brought to you by:
derrickoswald
|
From: Dipesh S. <dip...@re...> - 2007-02-16 02:23:33
|
Hi there,=0A=0AI'm trying to build an HTML tree model using your parser. I =
have come up with this code so far:=0A=0Aimport org.htmlparser.Parser;=0A =
import org.htmlparser.util.NodeList;=0A import org.htmlparser.util.Par=
serException;=0A import org.htmlparser.parserapplications.filterbuilder.=
HtmlTreeModel;=0A=0A=0A =0A class Test=0A {=0A public static =
void main (String[] args)=0A {=0A try=0A {=0A =
Parser parser =3D new Parser ("http://www.deals2buy.com")=0A=
NodeList list =3D parser.parse (null);=0A Ht=
mlTreeModel Tree=3D new HtmlTreeModel(list);=0A System.out.p=
rintln (Tree.toString());=0A }=0A catch (ParserExcept=
ion pe)=0A {=0A pe.printStackTrace ();=0A =
}=0A }=0A }=0A=0A=0AHowever toString method simply prints the=
objects name. Could you please help me with a solution that prints out the=
whole HTML tree?=0A=0AThanks,=0AChikki |