Suresh Setty - 2007-01-29

Hello All,
I'm using the HTMLParser 1.6 . I'm looking to extract all the links which are available on a page. At that time, if the <A> tag is nested in the <DIV> tag, it's not able to pick that.

The code i'm using is :

String domainName="http://www.clawsonwindows.com";
parser=new Parser(domainName);
NodeList nodeList=parser.parse( new TagNameFilter("a"));
if(nodeList!=null){
    System.out.println("No. of Anchor tags are "+nodeList.size());                        for(int i=0;i<nodeList.size();i++){
        System.out.println(nodeList.elementAt(i).toHtml());
    }
}

Appropriate try...catch blocks are used.

Its working for the <A> tags, which are not in <Div> tags, not picking from the <Div> tags.

I'm looking forward for your help.

Regards,
Suresh N.