enlive/html-resource timeout

42 views
Skip to first unread message

Puru Parthasarathy

unread,
Feb 3, 2015, 11:12:00 PM2/3/15
to enliv...@googlegroups.com
Hi

I am getting an error while reading a html resource:

(defn get-index-links
  [index-url]
  (->
    index-url
    URL.
    enlive/html-resource
    (enlive/select [:a]))

 Unhandled java.net.SocketTimeoutException
   Read timed out

What is the best way of solving this? Does enlive have a timeout feature?

Thanks.

Christophe Grand

unread,
Feb 4, 2015, 4:45:21 AM2/4/15
to enlive-clj
hi,

html-resource is not meant to be used as a http client; you should build your own function on top of, say, clh-http, and feed the stream/reader of the response entity to html-resource.

Christophe

--
You received this message because you are subscribed to the Google Groups "Enlive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enlive-clj+...@googlegroups.com.
To post to this group, send email to enliv...@googlegroups.com.
Visit this group at http://groups.google.com/group/enlive-clj.
For more options, visit https://groups.google.com/d/optout.



--
On Clojure http://clj-me.cgrand.net/
Clojure Programming http://clojurebook.com
Training, Consulting & Contracting http://lambdanext.eu/
Reply all
Reply to author
Forward
0 new messages