fixed counter
This commit is contained in:
@@ -71,7 +71,7 @@ public class WebCrawler {
|
|||||||
* @param searchWord the word to search for
|
* @param searchWord the word to search for
|
||||||
*/
|
*/
|
||||||
public void search(String url, String searchWord) {
|
public void search(String url, String searchWord) {
|
||||||
int counter = 1;
|
int counter = 0;
|
||||||
while (this.pagesVisited.size() < amountOfPages) {
|
while (this.pagesVisited.size() < amountOfPages) {
|
||||||
String curUrl;
|
String curUrl;
|
||||||
CrawlBranch branch = new CrawlBranch();
|
CrawlBranch branch = new CrawlBranch();
|
||||||
@@ -80,8 +80,8 @@ public class WebCrawler {
|
|||||||
this.pagesVisited.add(url);
|
this.pagesVisited.add(url);
|
||||||
} else {
|
} else {
|
||||||
curUrl = this.nextUrl();
|
curUrl = this.nextUrl();
|
||||||
System.out.println(String.format("visiting page %s / %s",counter,amountOfPages));
|
|
||||||
counter++;
|
counter++;
|
||||||
|
System.out.println(String.format("visiting page %s / %s",counter,amountOfPages));
|
||||||
}
|
}
|
||||||
branch.crawl(curUrl);
|
branch.crawl(curUrl);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user