From: Jason Mcdonald Date: 2011-01-13T12:35:10+09:00 Subject: Re: Weird error using String#[] Nokogiri is easier... (see below) I would still like to know what exactly is causing the weird behavior in my original post though, if anyone knows. I can understand why encoding would result in incorrect parsing, but I don't understand why the encoding would mess up the hard coded portion of the call to puts still. Working Nokogiri example: require 'rubygems' require 'nokogiri' require 'open-uri' doc = Nokogiri::HTML(open("http://www.pennstateind.com/store/PKPARK-MAG.html")) #puts doc ret = doc.at("div#ProdAvailability") puts "ret: #{ret}" # Output: # ret:
# Outof Stock / Eta Mid January See Shipping Details
#
-- Posted via http://www.ruby-forum.com/.