this script is a part of a bigger one, when I run this script I get "<p></p>
" print out as well. How can I remove this?
I used this regex: m.gsub!(/(?=\S)(\d|\W)/,"")
But it only removed the char "<" and "/>"
Here is my script:
require 'open-uri'
require 'rexml/document'
include REXML
doc = REXML::Document.new(open('http://testnavet.skolverket.se/SusaNavExport/EmilObjectExporter?id=184594606&strId=info.uh.gu.GS5&EMILVersion=1.1').read)
doc.elements.each("//*[name()='ct:text'] | /ns:educationInfo/ns:extensionInfo/gu:guInfoExtensions/gu:guSubject/gu:descriptions/gu:description"){
|e| m = e.text
puts "Description: " + m
}