Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package filtrageURLs
- import library._
- object main extends FiltrageURLs {
- private var result : List[String] = List()
- def filtreAnnonce(h:Html):List[String] = {
- h match {
- case Tag("a",attributes,_) => {
- result = result :+ extraireLien(attributes)
- }
- case Tag(_,_,courant) => {
- for (e <- courant) {
- if (e != List()) filtreAnnonce(e)
- }
- }
- case _ => ()
- }
- }
- def extraireLien(a : List[(String, String)]) : String = {
- for (p <- a) {
- if(p._1 == "href") p._2
- }
- "yo"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement