Your html is still flat, so you have to work with the patterns that you 
see.
You have:
span
li
li
li
span
li
li
li
etc...

An ugly, brute force, one case solution is to:

read the page with Hpricot
remove the header
convert it to a simple string representation
stick your opening tag '<see>' at the head
stick your closing tag and a div end '</div></see>' at the tail
change all '<span>' to '</div><div><span>'
doctor up the new head from '<see></div><div>' to just '<see><div>'
re-create your Hproicot doc from the modified string

which takes about 8 lines of code.

YMMV
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to