progs/app1.scala
changeset 96 9fcd3de53c06
parent 93 4794759139ea
child 254 dcd4688690ce
equal deleted inserted replaced
95:dbe49327b6c5 96:9fcd3de53c06
     1 def get_page(url: String) : String = { 
     1 def get_page(url: String) : String = 
     2   try {
     2   Try(Source.fromURL(url).take(10000).mkString) getOrElse 
     3     Source.fromURL(url).take(10000).mkString  
     3     { println(s"  Problem with: $url"); ""}
     4   }
       
     5   catch {
       
     6     case e => {
       
     7       println("  Problem with: " + url)
       
     8       ""
       
     9     }
       
    10   }
       
    11 }
       
    12