I was attempting to experiment with Nokogiri::HTML::DocumentFragment and
using the following code
require ‘rubygems’
require ‘rest-open-uri’
require ‘nokogiri’
doc1 = Nokogiri::HTML(open(“c:/RUBY_OUT.TXT”));
doc2 = doc1.xpath("//table[@class=‘result’][2]");
doc3 = Nokogiri::HTML::DocumentFragment.new(doc2)
c:/RUBY_OUT.TXT contains a web page
doc2 = doc1.xpath("//table[@class=‘result’][2]");
extracts a single table from the web page
doc3 = Nokogiri::HTML::DocumentFragment.new(doc2)
blows IRB up - multiple lines flash and Interactive Ruby window closes.
If I subsitute “abc” for doc2 as argument it then executes and flags an
illegal data type.
Any suggestions as to how I can determine what is happening.
Don