parser = new Parser(this.defaultHost + this.webFile.getURI().getPath()); ObjectFindingVisitor visitor = new ObjectFindingVisitor (LinkTag.class); parser.visitAllNodesWith (visitor); Node[] links = visitor.getTags (); for (int i = 0; i < links.length; i++) { LinkTag linkTag = (LinkTag)links[i];   try { this.downloadManager.addHtmlFile(new URI(linkTag.getLink()), depthParent+1); } catch (URISyntaxException e) { System.err.println("INVILID URI: " + linkTag.getLink());
if (!isCancelled()) { parser = new Parser(this.defaultHost + this.webFile.getURI().getPath()); ObjectFindingVisitor visitor = new ObjectFindingVisitor (LinkTag.class); parser.visitAllNodesWith (visitor); Node[] links = visitor.getTags (); for (int i = 0; i < links.length; i++) { if (!isCancelled()) { LinkTag linkTag = (LinkTag)links[i];   try { this.downloadManager.addHtmlFile(new URI(linkTag.getLink()), depthParent+1); } catch (URISyntaxException e) { System.err.println("INVILID URI: " + linkTag.getLink()); } } else { break; }
	public void parseHtml(WebFile parent) {				int depthParent = parent.getDepth();		Parser parser;		Node [] images;		try {			parser = new Parser(this.defaultHost + this.webFile.getURI().getPath());			images = parser.extractAllNodesThatAre (ImageTag.class);			for (int i = 0; i < images.length; i++)			{				ImageTag imageTag = (ImageTag)images[i];				//System.out.println (imageTag.getImageURI ());				try {					this.downloadManager.addLinkedFile(new URI(imageTag.getImageURL()), depthParent+1, parent);				} catch (URISyntaxException e) {					System.err.println("INVILID URI: " + imageTag.getImageURL());				}			}			parser = new Parser(this.defaultHost + this.webFile.getURI().getPath());			ObjectFindingVisitor visitor = new ObjectFindingVisitor (LinkTag.class);			parser.visitAllNodesWith (visitor);			Node[] links = visitor.getTags ();			for (int i = 0; i < links.length; i++)			{				LinkTag linkTag = (LinkTag)links[i];				//System.out.print ("\"" + linkTag.getLinkText () + "\" => ");				//System.out.println (linkTag.getLink ());				try {					this.downloadManager.addHtmlFile(new URI(linkTag.getLink()), depthParent+1);				} catch (URISyntaxException e) {					System.err.println("INVILID URI: " + linkTag.getLink());				}			}		} catch (ParserException e) {			System.err.println(e);		}	}