Scala and HTML parsing

Spread the love

Question Description

How do you load an HTML DOM document into Scala? The XML singleton had errors when trying to load the xmlns tags.

import scala.xml._

object NetParse {

   import{URLConnection, URL}
   import scala.xml._

   def netParse(sUrl: String): Elem = {
       var url = new URL(sUrl)
       var connect = url.openConnection


Finally I found a solution! – Requires scala 2.7.7 or higher to work (2.7.0 has a fatal bug):

Practice As Follows

This may help you
Processing real world HTML as if it were XML in scala

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.