@Override
    public void visit(Page page) {          
            if (page.getParseData() instanceof HtmlParseData) {
                    HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();
                    try {
                    	System.out.println(page.getWebURL().getURL());
                    	String text = htmlParseData.getText();
                        String html = htmlParseData.getHtml();
                        List<WebURL> outgoingLinks = htmlParseData.getOutgoingUrls();
                    	PrintWriter outFile = new PrintWriter(
                    							new BufferedWriter(
                    									new OutputStreamWriter (
                    											new FileOutputStream("data/rawText.txt",true)
                    									, "UTF-8")
                    							)
                    						);
                    	outFile.println( "<<<" + page.getWebURL().getDocid() + ">>>");
                    	outFile.println(page.getWebURL().getURL());
                    	List<String> title = TextProcessor.tokenize(htmlParseData.getTitle());
                    	System.out.print("Title: ");
                    	for(String word : title){
                    		outFile.print(word + " ");
                    		System.out.print(word + " ");
                    		
                    	}
                    	outFile.print(System.lineSeparator());
        				List<WebURL> validOutgoingLinks = new LinkedList<WebURL>();
        				for(WebURL link : outgoingLinks) {
        					if (link.getDocid() >= 0){
        						validOutgoingLinks.add(link);
        					}
        				}
        				outFile.println(validOutgoingLinks.size());
        				for(WebURL link : validOutgoingLinks){
        					String anchorText = link.getAnchor();
        					if(anchorText == null){
        						anchorText = "NULL_ANCHOR_TEXT";
        					}
        					else{
        						List<String> words = TextProcessor.tokenize(anchorText);
        						anchorText = "";
        						for(String word : words)
        							anchorText += word + " ";
        						if(anchorText == "")
        							anchorText = "NULL_ANCHOR_TEXT";
        					}
        					outFile.println(link.getDocid() + " " + anchorText);
        				}
        				outFile.println(text);
        				outFile.close();
        				
        				
        				System.out.println("Html length: " + html.length());
        				
        			} catch (IOException e) {
        				e.printStackTrace();
        			}
                    
                    /*
                    System.out.println("Charset: " + page.getContentCharset());
                    System.out.println("Content Data: " + page.getContentData().toString());
                    System.out.println("Encoding: " + page.getContentEncoding());
                    System.out.println("Content type: " + page.getContentType());
                    System.out.println("Fetch Response Headers: " + page.getFetchResponseHeaders());
                    System.out.println("Html: " + htmlParseData.getHtml());
                    System.out.println("OutgoingUrl: " + htmlParseData.getOutgoingUrls().get(0));
                    System.out.println("Title: " + htmlParseData.getTitle());
                   
                    System.out.println("Text length: " + text.length());
                    System.out.println("Html length: " + html.length());
                    System.out.println("Number of outgoing links: " + links.size());
                    */
                    
            }
    }