[Htmlparser-user] How to get the content of the column
Brought to you by:
derrickoswald
|
From: dink <di...@mi...> - 2005-12-10 16:34:17
|
Hello,
I am a beginner to use the html parser and would like to thank the =
contributors to this tool.
When I want to get the content of the table, I encounter some problems.
The table I want to parse is like below:
<table>
<TR>
<TD><b>HTML</b></TD>
</TR>
</table>
The code used is:
NodeList tables =3D parser.parse (new TagNameFilter ("TABLE"));
TableTag table =3D (TableTag) tables.elementAt(0); //There is only =
one Table
TableRow row =3D table.getRows (0); //There is =
only one TR
TableColumn column =3D row.getColumn(); //get the TD
System.out.println(column.getChildren (); //print the =
content of TD
The output is:
0 tag:b
1 txt:HTML
2 end:/b
Can somebody tell me how to only get the content,"HTML"? And if there =
are some attributes in the tag <b>, e.g. <b attribute=3Dxxx>,how can I =
get the attribute value "xxx"?
Thanks in advance.
Dink Lo |