From 9946dc9d128be8c86fc27b5073c05f3be0851a53 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Tue, 3 Mar 2020 17:39:42 +0100 Subject: [PATCH] fixed counter --- src/main/java/webcrawler/WebCrawler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/webcrawler/WebCrawler.java b/src/main/java/webcrawler/WebCrawler.java index ae2ee17..f9e6bcf 100644 --- a/src/main/java/webcrawler/WebCrawler.java +++ b/src/main/java/webcrawler/WebCrawler.java @@ -71,7 +71,7 @@ public class WebCrawler { * @param searchWord the word to search for */ public void search(String url, String searchWord) { - int counter = 1; + int counter = 0; while (this.pagesVisited.size() < amountOfPages) { String curUrl; CrawlBranch branch = new CrawlBranch(); @@ -80,8 +80,8 @@ public class WebCrawler { this.pagesVisited.add(url); } else { curUrl = this.nextUrl(); - System.out.println(String.format("visiting page %s / %s",counter,amountOfPages)); counter++; + System.out.println(String.format("visiting page %s / %s",counter,amountOfPages)); } branch.crawl(curUrl);