progs/crawler2.scala
changeset 95 dbe49327b6c5
parent 93 4794759139ea
child 96 9fcd3de53c06
--- a/progs/crawler2.scala	Wed Aug 07 17:31:42 2013 +0100
+++ b/progs/crawler2.scala	Tue Sep 24 01:12:36 2013 +0100
@@ -7,8 +7,8 @@
     Source.fromURL(url).take(10000).mkString  
   }
   catch {
-    case e => {
-      println("  Problem with: " + url)
+    case _ : Throwable => {
+      println(s"  Problem with: $url")
       ""
     }
   }
@@ -33,7 +33,7 @@
   if (n == 0) ()
   else if (my_urls.findFirstIn(url) == None) ()
   else {
-    println("Visiting: " + n + " " + url)
+    println(s"Visiting: $n $url")
     for (u <- get_all_URLs(get_page(url))) crawl(u, n - 1)
   }
 }