[Htmlparser-developer] about lexer.getNextNode().getParent()
Brought to you by:
derrickoswald
From: du du <tel...@ya...> - 2003-11-03 19:47:36
|
Hello everyone: i'd like to locate a specific sptring in a html page and then process information around it, so the whole scenario as: <html> <head>...</head> <body><table> <tr><td><p class=tablehead><b>Closing Time</b> </p></td></tr> <tr>.....</tr> </table> </body></html> In fact, I can locate "Closing Time", as well as its lexerNode, and thus, I could further locate its parentNode or children nodes. But when I using aNode.getParentNode() always throw null point error. Part of code like: ... Node aNode = lexer.nextNode(); Node bNode; while(aNode != null){ if (aNode.getText().indexOf("Closing Time")!=-1){ bNode = aNode.getParent(); System.out.println("current node="+bNode.getText()); } aNode = lexer.nextNode(); } ... I'll be very appreciate if somebody could give me help. henry --------------------------------- Post your free ad now! Yahoo! Canada Personals |