¿Obtener enlace y texto href del documento html con Nokogiri y Ruby?
Estoy tratando de usar la gema nokogiri para extraer todas las URL de la página, así como el texto del enlace y almacenar el texto del enlace y la url en un hash.
<html>
<body>
<a href=#foo>Foo</a>
<a href=#bar>Bar </a>
</body>
</html>
Me gustaria regresa
{"Foo" => "#foo", "Bar" => "#bar"}