Thank u i have done different method m using gsub operator i replaces the
tags to the form ,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
On Wed, Sep 9, 2009 at 6:42 PM, Frederick Cheung <[email protected]
> wrote:
>
>
>
> On Sep 9, 12:50 pm, prashanth hiremath <[email protected]>
> wrote:
> > Hi
> >
> > Please help me i want to replace the tag
> >
> > </li><span> to </li></see><see><span> at time
> >
> > can anybody in world give me an solution
> >
>
> A little more context would be helpful.
>
> Fred
> > Regards
> >
> > Prashant
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---