how to translate this hpricot code to nokogiri ?

Posted by wefwgeweg on Stack Overflow See other posts from Stack Overflow or by wefwgeweg
Published on 2010-04-16T01:50:32Z Indexed on 2010/04/16 1:53 UTC
Read the original article Hit count: 344

Filed under:
|
 Hpricot(html).inner_text.gsub("\r"," ").gsub("\n"," ").split(" ").join(" ")

hpricot = Hpricot(html)
hpricot.search("script").remove
hpricot.search("link").remove
hpricot.search("meta").remove
hpricot.search("style").remove

found it on http://www.savedmyday.com/2008/04/25/how-to-extract-text-from-html-using-rubyhpricot/

© Stack Overflow or respective owner

Related posts about nokogiri

Related posts about hpricot