Questions tagged [enlive]

Enlive is a Clojure library for HTML/XML extraction, transformation, and templating.

Enlive is a Clojure library for HTML/XML extraction and transformation.

Links:

89 questions
2
votes
2 answers

Enlive - extract original HTML

Is it possible to retrieve the original HTML (with its quirks and formatting) using enlive selectors? (def data "

some text
some more text

") (apply str (enlive/emit* (enlive/select (enlive/html-snippet…
George Armhold
  • 30,824
  • 50
  • 153
  • 232
2
votes
1 answer

Reading web page with log in (clojure)

I need to download some contents of a web page daily and I plan on using enlive for that. Trouble is, that I need to log in in with a POST first and the authentification of the page that I am interested in is then done with the session's cookies. So…
Majnu
  • 524
  • 4
  • 14
2
votes
2 answers

HTML extraction of MLA references with Enlive and Clojure

My objective is to extract and parse a series of bibliographical references from a webpage for entry into a database later. The references are all in MLA format. This should be a general solution, for all instances of MLA-format bibliographies, and…
Ben
  • 574
  • 3
  • 12
2
votes
2 answers

Cannot call enlive snippet via its name stored in a variable

I'm trying to do something simple with Clojure Enlive lib: I want the top menu of my page to be different based on language selected by the user (English or Japanese). I can't find how to implement this basic feature. I have a "template/header.html"…
ogaucher
  • 33
  • 3
2
votes
2 answers

Enlive - Wrap tags around HTML from file

So I have the following HTML in logout.html:
It looks like I need some function to read logout.html as enlive…
deadghost
  • 5,017
  • 3
  • 34
  • 46
2
votes
1 answer

Enlive snippet in template produces lazy sequence

Visiting localhost:3001/test results in the following HTML: clojure.lang.LazySeq@27237276 Clojure Code: (ns notebook.handler (:require [compojure.core :refer :all] [compojure.handler…
deadghost
  • 5,017
  • 3
  • 34
  • 46
2
votes
1 answer

How to generate a list of a pair of elements in Enlive?

I'm new to Enlive. I found that I can iterate with clone-for, however, it works for single element. I want to generate a list of a pair of elements like the following:
ntalbs
  • 28,700
  • 8
  • 66
  • 83
2
votes
1 answer

Get attribute of html tag - Enlive

I was trying to get src attribute of img tag that has attribute itemprop set to some value. Ok, I got the img tag and I'm able to extract inner text according to quesetion I asked here earlier today (in this case there is no text obviously), but I…
Vuk Stanković
  • 7,864
  • 10
  • 41
  • 65
2
votes
1 answer

Handling response code: 403 for URL with clojure enlive

I am trying to scrape content of a web page using enlive's html-resource function, but I am getting response 403, because I am not coming from a browser.I guess this can be overridden in Java (found answer here) , but I would like to see a clojure…
Мitke
  • 310
  • 3
  • 17
2
votes
1 answer

Range selectors in enlive

I'm trying to create a range selector, and can't seem to get off the ground. I'm trying things like: (sniptest "

Hi

There

" [{[:.start] [:.end]}] (content "Hello")) And that just returns the…
Khanzor
  • 4,830
  • 3
  • 25
  • 41
2
votes
1 answer

How do I write an Enlive selector to return "clusters" of tags?

I'm writing some Clojure code using Enlive to process a set of XML documents. They're in an XML format that borrows heavily from HTML but adds some custom tags, and my job is to convert them to real HTML. The custom tag that's bothering me the most…
rmunn
  • 34,942
  • 10
  • 74
  • 105
2
votes
3 answers

Using templates from outside the src folder in enlive

Is it possible to serve a template from outside the source folder in enlive ? I would like to pickup the templates from my resources/public/templates folder instead of the src/templates folder, how do I do that ? Thanks, Murtaza
murtaza52
  • 46,887
  • 28
  • 84
  • 120
1
vote
3 answers

Clojure (Enlive) How to use html/but (negation)

Hi All I'm trying to "parse/extract" html-data with Clojure en Enlive (any better choices ?) I am trying to get all the ul > li tags that are *NOT part of the
user914584
  • 571
  • 8
  • 15
1
vote
1 answer

Rendering images file to html page with moustache, enlive and Clojure

In my application with moustache (a micro framework to to wire Ring handlers and middlewares), enlive (as html template engine), and clojure, I can't view the images in my html file. How to render these file to html?
Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
1
vote
1 answer

How to reload enlive template?

I have a web application that uses enlive. If I change an html file used by a template I don't see the changes unless I restart figwheel. I am using ring.middleware.reload/wrap-reload like this: (-> routes (ring.middleware.reload/wrap-reload…
vidi
  • 2,056
  • 16
  • 34