changeset 97 | 60a3ba90dd53 |
parent 96 | 9fcd3de53c06 |
child 254 | dcd4688690ce |
96:9fcd3de53c06 | 97:60a3ba90dd53 |
---|---|
3 def crawl(url: String, n: Int) : Unit = { |
3 def crawl(url: String, n: Int) : Unit = { |
4 if (n == 0) () |
4 if (n == 0) () |
5 else if (my_urls.findFirstIn(url) == None) () |
5 else if (my_urls.findFirstIn(url) == None) () |
6 else { |
6 else { |
7 println(s"Visiting: $n $url") |
7 println(s"Visiting: $n $url") |
8 for (u <- get_all_URLs(get_page(url))) crawl(u, n - 1) |
8 for (u <- get_all_URLs(get_page(url))) |
9 crawl(u, n - 1) |
|
9 } |
10 } |
10 } |
11 } |