Hi
My first task was to extract links from pages
I looked at example and tried the following
NodeFilter filter =3D new NodeClassFilter (LinkTag.class=
);
NodeList list =3D parser.extractAllNodesThatMatch (filte=
r);
log("links follow:");
for (int i =3D 0; i < list.size (); i++)
log (list.elementAt (i).toHtml ());
this works fine if the partser was just constrcuted before running this cod=
e
On the other hand, if I put the following code preceeding the code above
NodeList nl =3D parser.parse (null);
log(nl.asString());
I get nothing for the links.
How do I structure my code when I want to do multiple things while
parsing a page.
For example, I want to extract links, I want to extract forms and form
fields, I want to extract text.
-Antony Sequeira
|