I wan't to scrape a website, which requires me to login. I've decided to use Jsoup to do this. I'm having trouble "translating" this line of code to Clojure properly:
Connection.Response loginForm = Jsoup.connect("**url**")
.method(Connection.Method.GET)
.execute();
Without specifying the class Connection.Response in my Clojure code, the connection has the class jsoup.helper.HttpConnect, which lacks methods I need to cookies from the session.
So far I've come up with the following Clojure code:
(import (org.jsoup Jsoup Connection
Connection$Response Connection$Method))
(do
(def url "*URL*")
(def res (doto (org.jsoup.Jsoup/connect url)
(.data "username" "*USERNAME*")
(.data "password" "*PASSWORD")
(.method Connection$Method/POST)
(.execute)))
(type res))