Skip to content

Instantly share code, notes, and snippets.

@tommorris
Created September 7, 2008 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommorris/9216 to your computer and use it in GitHub Desktop.
Save tommorris/9216 to your computer and use it in GitHub Desktop.
Example code for parsing HTML with libxml-ruby
require 'xml'
hp = XML::HTMLParser.string("<html><body><p>pooey</body></html>")
a = hp.parse
a.find("//p").to_a[0].first.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment