Giter Site home page Giter Site logo

Comments (5)

ifesdjeen avatar ifesdjeen commented on August 11, 2024

@marcolz it's very hard to say anything by just having a stacktrace.

I realize that the issue is already 8 months old, but could you provide more information?
If not - we probably have to close the issue.

from enlive.

strongh avatar strongh commented on August 11, 2024

This happened to me. Turned out it was due to passing enlive a PDF instead of HTML.

from enlive.

odues avatar odues commented on August 11, 2024

Thanks strongh, I had the same error and it turned out to be a PDF document.
In the REPL:

=> (def res (html/resource (java.net.URL. "http://www.ojd.com/file/document/5799PV201305201305")))
=> (html/select res [:p])
=> StackOverflowError   clojure.lang.RT.boundedLength (RT.java:1654)

Maybe I should check the HTTP Content-Type, but I can't see a method in Enlive to do that,
so I would need to make another call first (using clj-http.client) before calling Enlive.
And that would not help in this example because the Content-Type appears to be empty for this document...

from enlive.

strongh avatar strongh commented on August 11, 2024

@odues the way that I've worked around this has been to use pantomime to check the MIME type. It's effectively detected PDFs, etc. even without the Content-Type header.

from enlive.

odues avatar odues commented on August 11, 2024

Thanks. I'll do that.

from enlive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.