Re: query on how to read "data" for a particular TagNode

Derrick Oswald <[email protected]>
Newsgroups gmane.comp.parsers.htmlparser.user
Message-ID <[email protected]>
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 <[email protected]> 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&reg; 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/htmlparser-user
>
>

------------------------------------------------------------------------------
Download Intel&reg; 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlparser-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.