I'm using enlive for a work project, but thought I would try getting familiar with it through a side project.
I decided to do some scraping with it. Perhaps this is more than I bargained for. The html snippet that
I decided to scrape has almost no identifiers and no classes.
I tried posting this once, in great detail, so I'm a little annoyed to be posting again, so I'll be brief.
I need to turn something that is not a tree into a tree. It is, essentially an h3,span:content followed by
<div><table> <table/> <table/> <table/> </table> Each sub table has a single <th> which is it's name
followed by data rows which are the content.
What I want to create is a tree of these.
{:span-content {:th-content {:row-name :value :description }}}
I have a select which gives me the span next to the parent table for each group of tables. I'm perfectly willing
to take that seq and do what I need to do with clojure. But I'm wondering if I would be missing out on what
enlive can do for this problem.
Currently what I'm getting out my enlive select is this.
<span>
<table ........ <table> <table> ...
<table ........ <table> <table> ...
<table ........ <table> <table> ...
This is fine, but I don't see how to go any further with enlive.
My first instinct is to just iterate through the seq and walk the trees
as I go. I am only interested in the content, I can't see any need for any other attributes.
Is there a better way with enlive? I feel like I'm using pliers for a hammer.
Thanks.