# HG changeset patch # User Christian Urban # Date 1380293005 -3600 # Node ID 010ae7288327cd8e6aaa2d0786c3758877944b92 # Parent 86c1c049eb3edf1865deb11caeeeaa9ec4830f73 updated diff -r 86c1c049eb3e -r 010ae7288327 progs/crawler2.scala --- a/progs/crawler2.scala Fri Sep 27 15:05:50 2013 +0100 +++ b/progs/crawler2.scala Fri Sep 27 15:43:25 2013 +0100 @@ -23,7 +23,10 @@ def crawl(url: String, n: Int) : Unit = { if (n == 0) () - else if (my_urls.findFirstIn(url) == None) () + else if (my_urls.findFirstIn(url) == None) { + println(s"Visiting: $n $url") + get_page(url); () + } else { println(s"Visiting: $n $url") for (u <- get_all_URLs(get_page(url))) crawl(u, n - 1) @@ -34,6 +37,6 @@ val startURL = """http://www.inf.kcl.ac.uk/staff/urbanc/""" // can now deal with depth 3 and beyond -crawl(startURL, 4) +crawl(startURL, 3)