Re: [Htmlparser-user] query on how to read "data" for a particular TagNode
Brought to you by:
derrickoswald
From: Derrick O. <der...@gm...> - 2010-02-18 05:34:59
|
If you have the div tag, then since it is a composite node, "\nfoo\n" will be the first child: divtag.getChildren ()[0] On Thu, Feb 18, 2010 at 5:16 AM, Rajorshi Biswas <raj...@in...> wrote: > Hello, > I am new to htmlparser, so please forgive me if this is a naive question. I > have an HTML fragment for which I need to determine if the first visible > text is in bold or not. > > For this, I am trying to get the 'first' text content of the fragment. > Suppose the fragment is of the following form: > > <div> > foo > <p>something</p> > <span>something else</span> > </div> > > My question is: how do I get the "data" portion of the 'div'. That is, when > I arrive at the "div" node (Div object), I wish to retrieve the content of > the div WITHOUT its children elements - I wish to retrieve "foo" in this > case. > > I could not find an API in the Node/TagNode classes for this. Could anyone > please help me out here? > > > Thanks in advance! > Raj > > > Dear *htmlparser-user!* Get Yourself a cool, short *@in.com* Email ID now!<http://mail.in.com/mails/new_reg.php?utm_source=invite&utm_medium=outgoin+g> > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user > > |