fixed bug
This commit is contained in:
@@ -15,6 +15,7 @@ public class Main {
|
|||||||
boolean save = getChoice(scanner.nextLine());
|
boolean save = getChoice(scanner.nextLine());
|
||||||
System.out.print("Do you want to enable debug mode? (Y/N) : ");
|
System.out.print("Do you want to enable debug mode? (Y/N) : ");
|
||||||
boolean debug = getChoice(scanner.nextLine());
|
boolean debug = getChoice(scanner.nextLine());
|
||||||
|
if (debug) System.out.println("[INFO] - Debug mode enabled");
|
||||||
WebCrawler crawler = new WebCrawler(amount,save,debug);
|
WebCrawler crawler = new WebCrawler(amount,save,debug);
|
||||||
crawler.search(startUrl,word);
|
crawler.search(startUrl,word);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class WebCrawler {
|
|||||||
int counter = 0;
|
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(debug);
|
||||||
if (this.pagesPending.isEmpty()) {
|
if (this.pagesPending.isEmpty()) {
|
||||||
curUrl = url;
|
curUrl = url;
|
||||||
this.pagesVisited.add(url);
|
this.pagesVisited.add(url);
|
||||||
|
|||||||
Reference in New Issue
Block a user