sourceforge htmlparser1_5 examples

D

DRS.Usenet

I looked at parserapplications "LinkExtractor" and "StringExtractor" -
got them running - but they are not exactly what I need, really.

Situation 1:

Given this in the html:
<DIV class=someclass>I want this text here</DIV>

I've been able to make a new NodeClassFilter(Div.class), and spin
through all nodes that match and check tag.getAttribute("class"). When
I find "someclass", I know I'm where I want to be, but I don't know
what to do to get the text inside the DIV. Which example (if any)
shows that?

Situation 2:

Given this in the html:
<P><A name=someTitle><SPAN>SomeTitle</SPAN><BR>
Item 1, <a href="/somepath/some.html">Item 2</a>,Item 3<BR>
<P>...

I would like to get something equal to:
String[] hGrail = {"Item 1", "Item 2", "Item 3"};

On this one, I have no ideas. I've tried to look at how the "<a
href=..." has been done, but didn't get very far.

Please, any examples or pointers to examples.

--Dale--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top