I get 2 errors:
Type mismatch: cannot convert from boolean to Element
Type mismatch: cannot convert from Element to boolean
both at that line. Now what to do?
Well, it's considered to be bad style to init Objects like that and to compare there value at the same time.
so let's change it:
while(true)
{
elem = it.next();
if(elem == null) break;
if( elem.getName().equals( "img") )
{
String s = (String) elem.getAttributes().getAttribute(HTML.Attribute.SRC);
if( s != null )
System.out.println (s );
}
}