2009/9/10 prashanth hiremath <[email protected]>:
>
> Thank u i have done what u told using gsub operator i replaces the tags to
> the form as u told,but problem is that
>
> if
>         doc = Hpricot(open('Delhi.txt'))
>           x=doc.to_s
>           doc1=x.gsub(/<(\/?)li><span>/,'</li></see><see><span>')
>
>           puts doc1
>           doc1.search('span').each do |y|
>           puts y.inner_text
>          end
>
>
> its giving error
>
>  undefined method `search' for #<String:0xb7d0bc74> (NoMethodError)
> because doc1 is string how can i conevrt so that i can read the file again
> by hpricot

Please don't top post, it annoys readers on this list and makes it
less likely that you will get help.

I have not used hpricot but if I were in your situation the first
thing I would do is carefully look through the documentation for
hpricot.  Have you done that?

Colin

--~--~---------~--~----~------------~-------~--~----~
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