Wow, that's exactly what I am looking for. Thanks Creighton!!

Mike


On Thursday, August 14, 2014 4:28:54 AM UTC-7, Creighton Kirkendall wrote:
> Li,
> With that use case I would not recommend using either enfocus or domina.  A 
> better tool would be hickory: https://github.com/davidsantiago/hickory.  It 
> allows you to parse the string into a clojure data structure and traverse it 
> with selectors. 
> 
> 
> 
> Creighton
> 
> 
> 
> On Thu, Aug 14, 2014 at 12:58 AM, Li Dong bin <[email protected]> wrote:
> 
> Hi Creighton:
> 
> Thanks for your reply.
> 
> Here is what I want to do, I want to scrap a webpage. Right now I have the 
> html string which I get by a ajax call: 
> "<html>....<a>link1</a><a>link2</a>...</html>"
> 
> 
> 
> So I want to extract the links from this string, normally in Clojure side, I 
> can use enlive to select the links: (enlive/select [:a] html-string).
> 
> 
> 
> I was wondering can I do the same thing using domina, I know there is a 
> higher abstracted library enfocus, which I know you are also the author :-). 
> But I thought that library is more for transform templates, instead of 
> scrapping content(css select elements) from a given DOM(or string).
> 
> 
> 
> 
> So should I use enfocus? I searched all the places to find some examples, but 
> no luck. Could you give me more information about using domina/enfocus to 
> scrap DOM/html-string ?
> 
> 
> 
> Thanks a lot!
> 
> 
> 
> 
> 
> 
> On Wednesday, August 13, 2014 6:15:02 PM UTC-7, Creighton Kirkendall wrote:
> 
> > Li,
> 
> > Can you give me a bit more description what you are trying to do.  If you 
> > are looking to manipulate css and raw html in the browser, I would 
> > recommend looking at enfocus. Its a higher level abstraction than domina 
> > and has pretty solid documentation.  I contains tools for extracting and 
> > transforming html through css selectors and simple functions.  
> 
> 
> >
> 
> >
> 
> >
> 
> > Documentation: http://ckirkendall.github.io/enfocus-site/
> 
> >
> 
> >
> 
> >
> 
> > Creighton
> 
> >
> 
> >
> 
> >
> 
> >
> 
> 
> > On Wed, Aug 13, 2014 at 11:15 AM, Li Dong bin <[email protected]> wrote:
> 
> >
> 
> > Hi:
> 
> >
> 
> >
> 
> >
> 
> > I am trying to use domina to scrap a html string. But I can not get it 
> > work, I've tried following approaches by reading the source code of domina, 
> > but always got empty string back. Am I using it wrong?
> 
> >
> 
> >
> 
> >
> 
> > In order to use css/sel, I have to have a dom elements. But I don't deal 
> > with the real dom, instead I have a dom string.
> 
> >
> 
> >
> 
> >
> 
> > I tried to use domina/html-to-dom, but it always give back empty string to 
> > me.
> 
> >
> 
> >
> 
> >
> 
> > (domina/html-to-dom "<div><a href='#'>TEST LINK</a></div>") ;; always 
> > return empty string
> 
> >
> 
> >
> 
> >
> 
> > Anyone used domina before can help? Thanks a lot!
> 
> >
> 
> >
> 
> >
> 
> > --
> 
> >
> 
> > Note that posts from new members are moderated - please be patient with 
> > your first post.
> 
> >
> 
> > ---
> 
> >
> 
> > You received this message because you are subscribed to the Google Groups 
> > "ClojureScript" group.
> 
> >
> 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to [email protected].
> 
> >
> 
> > To post to this group, send email to [email protected].
> 
> 
> 
> >
> 
> > Visit this group at http://groups.google.com/group/clojurescript.
> 
> 
> 
> --
> 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> 
> ---
> 
> You received this message because you are subscribed to the Google Groups 
> "ClojureScript" group.
> 
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> 
> To post to this group, send email to [email protected].
> 
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to