On Sun, Mar 16, 2008 at 12:30 PM, Junkone <junkone1 / gmail.com> wrote:
> hello
>  I am trying to grab the table that has a html comment in it. for eg
>
>  <TABLE cellSpacing=1 width="80%" align=center border=0><!--
>  startingtable -->
>
>  how can i do using search functionality in hpricot.
>
>  appreciate any help
>
>

There's probably a better way, but without looking at the docs I would
probably find my table and then maybe #inner_html followed with a
regexp.

For example...

require "hpricot"
str = <TABLE cellspacing=1 width= 80% align=center border=0><!--
startingtable -->
doc = Hpricot(str)
p doc.search("table").inner_html

=>"<!-- startingtable -->\n"

It's interesting to note that hpricot picked it out even though that
string is really malformed html.

Todd