我有html页面,其中包含一些html实体,如"".
#Here I am not pasting whole html page content. just putting issue line only
html_file = "<html>....<body><p>they’re originally intended to describe the spread of of viral diseases, but they&#146;re nice analogies for how web/SN apps grow.<p> ...</body></html>"
doc = Nokogiri::HTML(html)
body = doc.xpath('//body')
body_content = body[0].inner_html
puts body_content
Run Code Online (Sandbox Code Playgroud)
结果:
These terms come from the fields of medicine and biology they\u0092re originally intended to describe the spread of of viral diseases, but they\u0092re nice analogies for how web/SN apps grow. …
Run Code Online (Sandbox Code Playgroud)