Matthew Ling

  • Archive
  • RSS
  • Ask me anything

Quickly parse with Nokogiri

This is a reminder for myself because I always forget the different ways for getting at data with Nokogiri.

doc = Nokogiri::XML(xml_doc)
objects = doc.xpath("//object")
value = objects.first.text
attribute = objects.first['attribute_name']
 	
    • #nokogiri
    • #xml
    • #code
    • #reminder
  • 7 months ago
  • 11
  • Comments
  • Permalink
  • Share
    Tweet

11 Notes/ Hide

  1. login93026 liked this
  2. yeseniauio09 liked this
  3. murphytii0 liked this
  4. brendaca83 liked this
  5. matthewling posted this

Recent comments

Blog comments powered by Disqus
← Previous • Next →

About

The reluctant programmer ...

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr