当前位置: 代码迷 >> HTML/CSS >> 应用Nokogiri简单抽取HTML文本
  详细解决方案

应用Nokogiri简单抽取HTML文本

热度:733   发布时间:2012-12-18 12:43:41.0
使用Nokogiri简单抽取HTML文本
irb(main):023:0>  html =<<-HTML
<div class="doc-description toggle-overflow-contents">
<div id="doc-original-text">“Shave Me!” combines touchscreen game fun with close-shave precision perfection.<p>The iOS shaving sensation has arrived in the Android Market! “Shave Me!” combines the fun of touch-screen games with the precision of the perfect close shave with optimized play and graphics for any Android 2.0 device.</p>
<p>For those with beard jealousy, a steady hand or an OCD-like obsession for a clean shave, “Shave Me!” provides endless entertainment and elevates the everyday ritual of shaving to an art form. Use it to draw pictures, write messages, or simply kick back with a shave to unwind after a stressful day. It’s oddly therapeutic!</p>
<p>The free version of "Shave Me!" is ad-supported. We offer a $0.99 ad-free version as well!</p>
<p>Open up the Shaving Kit and choose your weapon: how will YOU accomplish a close shave? Choose from the classic Single-blade Razor, Electric Razor, Tweezers or Straight Razor, and use Shaving Cream, Toilet Paper Dots and Hair-Gro Tonic to assist you in your shaving quest. Sick of seeing that smooth, shaved patch of skin? Simply shake your device and watch hair grow back before your eyes.</p>
<p>Just use a finger swipe to shave off every last bit of stubble. If you’re good you can achieve a nice smooth shave in only a couple of tries, but be cautious: careless or rushed shaving can result in a painful razor burn! Too squeamish to deal with blood? The Blood Toggle option lets you shave without the threat of cuts or bleeding.</p>
<p>“Shave Me!” uses aspects of smartphone technology to deliver the ultimate shaving experience:</p>
<p>● Vibration when you draw blood<br>● Shake to regrow hair instantly<br>● Stereo sound effects<br>● Music playback: enjoy your personal soundtrack while shaving!</p>
<p>Leave us a review and tell us what you think!</p>
<p>Show us some love:<br>Twitter: <a href="http://www.google.com/url?q=http://www.twitter.com/wemakegames&amp;usg=AFQjCNEshqz-sSMscykRLsgusXLbRvZgIQ" target="_blank">http://www.twitter.com/wemakegames</a><br>Facebook: <a href="http://www.google.com/url?q=http://www.facebook.com/metaversalstudios&amp;usg=AFQjCNEhiYnjVmQCW2rV96KsHZAd5avv6w" target="_blank">http://www.facebook.com/metaversalstudios</a></p>
</div>
<div id="doc-translated-text" style="display:none">“剃须我!”结合紧密刮胡子精密完美的触摸屏游戏的乐趣。<p>IOS剃须感觉在Android Market已经来临! “剃须我!”结合了完美的句号高精度触摸屏游戏的乐趣剃任何Android 2.0设备优化的播放和图形。</p>
<p>对于那些胡子嫉妒,一个稳定的手或一个洁净的剃须强迫症般的痴迷,“剃须我!”提供无尽的娱乐和剃须一种艺术形式,提升了日常仪式。用它画,写邮件,或者干脆用刮胡子到紧张的一天后放松,踢。这是奇怪的治疗!</p>
<p>免费版的“剃须我!”广告支持。我们提供了一个$ 0.99无广告版的!</p>
<p>打开剃须工具包,并选择你的武器,你将如何完成一个刮胡?从经典的单刃剃须刀,电动剃须刀,镊子或直线型刀片,选择和使用剃须膏,卫生纸点发格罗进补,以协助您在您的剃须任务。看到,皮肤光滑,剃光补丁而烦恼吗?只要摇动您的设备和观看的头发长在你的眼前。</p>
<p>只要用手指轻扫剃掉每茬的最后一位。如果你的好,你可以实现一个很好的顺利剃只有尝试,但要谨慎:粗心或送往剃须可能会导致在一个痛苦的剃!太娇气处理血?血切换选项,让你刮胡子没有削减或出血的威胁。</p>
<p>“剃须我!”使用智能手机技术的各个方面,提供极致的剃须体验:</p>
<p>●你抽血时的振动<br>●摇再生头发瞬间<br>●立体声音响效果<br>●音乐播放:享受您的个人的声音,而剃!</p>
<p>离开我们检讨,并告诉我们您的想法!</p>
<p>告诉我们一些爱:<br>Twitter的:<a href="http://www.google.com/url?q=http://www.twitter.com/wemakegames&amp;usg=AFQjCNEshqz-sSMscykRLsgusXLbRvZgIQ" target="_blank">http://www.twitter.com/wemakegames</a><br>FACEBOOK:<a href="http://www.google.com/url?q=http://www.facebook.com/metaversalstudios&amp;usg=AFQjCNEhiYnjVmQCW2rV96KsHZAd5avv6w" target="_blank">http://www.facebook.com/metaversalstudios</a></p>
</div>
</div>
<div class="doc-description-overflow"></div>
HTML

irb(main):049:0> puts Nokogiri::HTML(html).text

“Shave Me!” combines touchscreen game fun with close-shave precision perfection.The iOS shaving sensation has arrived in the Android Market! “Shave Me!” combines the fun of touch-screen games with the precision of the perfect close shave with optimized play and graphics for any Android 2.0 device.
For those with beard jealousy, a steady hand or an OCD-like obsession for a clean shave, “Shave Me!” provides endless entertainment and elevates the everyday ritual of shaving to an art form. Use it to draw pictures, write messages, or simply kick back with a shave to unwind after a stressful day. It’s oddly therapeutic!
The free version of "Shave Me!" is ad-supported. We offer a $0.99 ad-free version as well!
Open up the Shaving Kit and choose your weapon: how will YOU accomplish a close shave? Choose from the classic Single-blade Razor, Electric Razor, Tweezers or Straight Razor, and use Shaving Cream, Toilet Paper Dots and Hair-Gro Tonic to assist you in your shaving quest. Sick of seeing that smooth, shaved patch of skin? Simply shake your device and watch hair grow back before your eyes.
Just use a finger swipe to shave off every last bit of stubble. If you’re good you can achieve a nice smooth shave in only a couple of tries, but be cautious: careless or rushed shaving can result in a painful razor burn! Too squeamish to deal with blood? The Blood Toggle option lets you shave without the threat of cuts or bleeding.
“Shave Me!” uses aspects of smartphone technology to deliver the ultimate shaving experience:
● Vibration when you draw blood● Shake to regrow hair instantly● Stereo sound effects● Music playback: enjoy your personal soundtrack while shaving!
Leave us a review and tell us what you think!
Show us some love:Twitter: http://www.twitter.com/wemakegamesFacebook: http://www.facebook.com/metaversalstudios

“剃须我!”结合紧密刮胡子精密完美的触摸屏游戏的乐趣。IOS剃须感觉在Android Market已经来临! “剃须我!”结合了完美的句号高精度触摸屏游戏的乐趣剃任何Android 2.0设备优化的播放和图形。
对于那些胡子嫉妒,一个稳定的手或一个洁净的剃须强迫症般的痴迷,“剃须我!”提供无尽的娱乐和剃须一种艺术形式,提升了日常仪式。用它画,写邮件,或者干脆用刮胡子到紧张的一天后放松,踢。这是奇怪的治疗!
免费版的“剃须我!”广告支持。我们提供了一个$ 0.99无广告版的!
打开剃须工具包,并选择你的武器,你将如何完成一个刮胡?从经典的单刃剃须刀,电动剃须刀,镊子或直线型刀片,选择和使用剃须膏,卫生纸点发格罗进补,以协助您在您的剃须任务。看到,皮肤光滑,剃光补丁而烦恼吗?只要摇动您的设备和观看的头发长在你的眼前。
只要用手指轻扫剃掉每茬的最后一位。如果你的好,你可以实现一个很好的顺利剃只有尝试,但要谨慎:粗心或送往剃须可能会导致在一个痛苦的剃!太娇气处理血?血切换选项,让你刮胡子没有削减或出血的威胁。
“剃须我!”使用智能手机技术的各个方面,提供极致的剃须体验:
●你抽血时的振动●摇再生头发瞬间●立体声音响效果●音乐播放:享受您的个人的声音,而剃!
离开我们检讨,并告诉我们您的想法!
告诉我们一些爱:Twitter的:http://www.twitter.com/wemakegamesFACEBOOK:http://www.facebook.com/metaversalstudios


  相关解决方案