[Htmlparser-developer] about visitor
Brought to you by:
derrickoswald
|
From: du du <tel...@ya...> - 2003-09-20 06:48:33
|
I want to write a piece of code to implement auto-fill web page form.I try to use NodeVisitor.But I puzzled at :
1)String [] tagsToBeFound = {"FORM","INPUT"};
TagFindingVisitor visitor = new TagFindingVisitor(tagsToBeFound);
parser.visitAllNodesWith(visitor);
Node [] allformTags = visitor.getTags(0);
FormTag formtag = (FormTag)allformTags[0];
Node [] allinputTags = visitor.getTags(1);
InputTag inputtag = (InputTag)allinputTags[0];
there is an java.lang.ClassCastException: org.htmlparser.tags.Tag
why?
2)if I write a customized visitor how do i write visitFormTag and visitInputTag so as to collect all the form tag and input tag together?
3)if I use RemarkNode to mark a form tag its relative input tags
together, how to decide the parameter tagContents?
thanks for any hints
---------------------------------
Post your free ad now! Yahoo! Canada Personals
|