using dispatch and xpath

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

using dispatch and xpath

maxfax2009
Hi

How would I mix xpath with HTML and dispatch?


/html/body/center/div/div/div/div/table/tbody/tr/td[2]



object getHttp {

val page = http("http://databinder.net/somepage.html" as_str)

}


Reply | Threaded
Open this post in threaded view
|

Re: using dispatch and xpath

n8han
Administrator
You can use scala's built-in XML traversing with the <> operator in dispatch. e.g.

http(:("example.com") / "something.xml" <> { xml_root =>
  // use xml_root, which is of type scala.xml.Elem
}

This will only work with well formatted XML. I think there are some lenient parsers around in Scala, maybe something in or used by Lift?

Nathan

On 11/17/2010 11:23 PM, maxfax2009 [via Databinder] wrote:
Hi

How would I mix xpath with HTML and dispatch?


/html/body/center/div/div/div/div/table/tbody/tr/td[2]



object getHttp {

val page = http("http://databinder.net/somepage.html" as_str)

}





View message @ http://databinder.3617998.n2.nabble.com/using-dispatch-and-xpath-tp5750413p5750413.html
To start a new topic under Databinder, email [hidden email]
To unsubscribe from Databinder, click here.