Using HTMLEditorKit to parse HTML
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Stephen_Ward
Posted On:   Tuesday, November 27, 2001 12:03 PM

Hi I have this code snippet that uses the HTMLEditorKit to retrieve a list of links from a html file ElementIterator it = new ElementIterator(doc); javax.swing.text.Element elem; while ((elem = it.next()) != null) { SimpleAttributeSet s = (SimpleAttributeSet) elem.getAttributes().getAttribute(HTML.Tag.A); if (s != null) { System.out.println( s.getAttribute(HTML.Attribute.HREF)); } However when I replace HTML.Tag.A with HTML.Tag.TD to get the contents of a table, nothing is found. Can anyone help?    More>>

Hi

I have this code snippet that uses the HTMLEditorKit to retrieve a list of links from a html file


			
ElementIterator it = new ElementIterator(doc);

javax.swing.text.Element elem;

while ((elem = it.next()) != null) {

SimpleAttributeSet s = (SimpleAttributeSet)
elem.getAttributes().getAttribute(HTML.Tag.A);


if (s != null) {


System.out.println(
s.getAttribute(HTML.Attribute.HREF));

}


However when I replace HTML.Tag.A with HTML.Tag.TD to get the contents of a table, nothing is found.


Can anyone help?    <<Less
About | Sitemap | Contact