I am retrieving the HTML from the web. I get "java.lang.OutOfMemoryError: Java heap space (repl-1:3)"
;; fetch: URL -> String
;; fetch returns the string of the HTML url
(defn fetch [url]
(with-open [stream (. url openStream)]
(let [buffer (BufferedReader. (InputStreamReader. stream))]
(apply str (line-seq buffer)))))
I think the problem is the "apply str" . Is there an easier way to
- Convert the buffered reader to string?
- or retrieve the web page?
Edit: I need to retrieve