From: Ross Bamford Date: 2006-01-04T19:57:57+09:00 Subject: Re: need script: convert html-text to text On Wed, 04 Jan 2006 10:30:03 -0000, keal wrote: > i have html-text. i have to convert this text to simple text without > html-tags. > It's tricky, there's more to it than you'd think. The best way is probably to use Lynx, or another browser, to do it for you, e.g.: def plain(url) `lynx -dump "#{url}"` end p = plain('http://www.google.com/') puts p Outputs: [1]Personalised Home | [2]Sign in [3]A picture of the Braille letters spelling out "Google." Happy Birthday Louis Braille! Web [4]Images [5]Groups [6]News [7]Froogle [8]more 損 > ... [snip] ... Of course you'll need lynx for that to work, but you can use others too. Try a Google search. Cheers, -- Ross Bamford - rosco@roscopeco.remove.co.uk