0

I'm trying to select the :li node that has, in is content, the word "(SCIAN":

<li>...</li>
<li class="">
                Conception de systèmes informatiques et services connexes (SCIAN 541510)
            </li>

<li>...</li>

I've fail trying this:

(html/select
    fetched
    [[:li (html/has [(html/re-pred #"\w*SCIAN\b")])]])))

Thank you for your help!

Notice: I've tried use these patterns without success so I might do something wrong: https://groups.google.com/forum/#!topic/enlive-clj/thlhc5zBRUw

leontalbot
  • 2,513
  • 1
  • 23
  • 32

2 Answers2

1

I think the regex in combination with french accents causes the problem:

    (def s "è")
    (def r #"\w") 
    (re-matches r s)
    ;;; => nil
    (def s "e")
    (re-matches r s)
    ;;; => "e"
Joe Lehmann
  • 1,087
  • 5
  • 10
1

To make that work, we actually don't need to use regex:

(html/select
    fetched
    [[:li (html/pred #(.contains (html/text %) "SCIAN"))]])
leontalbot
  • 2,513
  • 1
  • 23
  • 32