title: Download HTML Text with Ruby
body: <p>I am trying to create a histogram of the letters (a,b,c,etc..) on a specified web page. I plan to make the histogram itself using a hash. However, I am having a bit of a problem actually getting the HTML.</p>
  
  <p>My current code:</p>
  
  <pre><code>#!/usr/local/bin/ruby
  
  
  require 'net/http'
  require 'open-uri'
  
  
  # This will be the hash used to store the
  # histogram.
  histogram = Hash.new(0)
  
  def open(url)
      Net::HTTP.get(URI.parse(url))
  end
  
  page_content = open('_insert_webpage_here')
  
  page_content.each do |i|
      puts i
  end
  </code></pre>
  
  <p>This does a good job of getting the HTML. However, it gets it all. For www.stackoverflow.com it gives me:</p>
  
  <pre><code>&lt;body&gt;&lt;h1&gt;Object Moved&lt;/h1&gt;This document may be found &lt;a HREF="http://stackoverflow.com/"&gt;here&lt;/a&gt;&lt;/body&gt;
  </code></pre>
  
  <p>Pretending that it was the right page, I don't want the html tags. I'm just trying to get <code>Object Moved</code> and <code>This document may be found here</code>. </p>
  
  <p>Is there any reasonably easy way to do this?</p>