Skip to content

Commit

Permalink
Merge pull request #47 from tycho01/master
Browse files Browse the repository at this point in the history
allow setting cookies, fixes #46
  • Loading branch information
ruippeixotog authored Jun 24, 2017
2 parents c4f383e + da75012 commit 81f0573
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ class JsoupBrowser(val userAgent: String = "jsoup/1.8") extends Browser {
using(inputStream) { _ => JsoupDocument(Jsoup.parse(inputStream, charset, "")) }

def cookies(url: String) = cookieMap.toMap

def setCookie(url: String, key: String, value: String) = {
cookieMap += key -> value
}

def setCookies(url: String, m: Map[String, String]) = {
cookieMap ++= m
}

def clearCookies() = cookieMap.clear()

Expand Down

0 comments on commit 81f0573

Please sign in to comment.