Trouble using SimpleAttributeSet
0 posts in topic
Flat View  Flat View

Posted By:   sahil_k
Posted On:   Sunday, April 20, 2003 09:29 PM

I am having trouble using SimpleAttributeSet in trying to extract urls from a page. The program goes to a specified web page and tries to grab all urls on the page. Relevent part of the code is given below.

SimpleAttributeSet s = (SimpleAttributeSet) elem.getAttributes(). getAttribute(HTML.Tag.A);
if (s != null) {
String urlStr = s.getAttribute HTML.Attribute.HREF). toString();

For some root urls, the program works fine but for some, I get a null pointer exception at the last line in the above code.

Hoping for some advice. Thanx

About | Sitemap | Contact