title: Get link and href text from html doc with Nokogiri & Ruby?
body: <p>I'm trying to use the nokogiri gem to extract all the urls on the page as well their link text and store the link text and url in a hash.</p>
  
  <pre><code>&lt;html&gt;
      &lt;body&gt;
          &lt;a href=#foo&gt;Foo&lt;/a&gt;
          &lt;a href=#bar&gt;Bar &lt;/a&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I would like to return</p>
  
  <pre><code>{"Foo" =&gt; "#foo", "Bar" =&gt; "#bar"}
  </code></pre>