Skip to content

MarioRicalde/Nokogiri-to-Hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Usage

require 'rubygems'
require 'nokogiri'
require 'nokogiri_to_hash'
html = '
  <div id="hello" class="container">
    <p>Hello! visit my site <a href="http://kuroir.com">Kuroir.com</a></p>
  </div>
'
p Nokogiri.HTML(html).to_hash
=> [{:div=>{:class=>["container"], :children=>[{:p=>{:children=>[{:a=>{:href=>["http://kuroir.com"], :children=>[]}}]}}], :id=>["hello"]}}]

Cretaed by Mario Ricalde for HTML to SCSS converter.

About

Mix-in of the Nokogiri XML Node Class that implements methods to convert nodes to a hash.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages