From: Priyank Shah Date: 2010-11-15T19:04:08+09:00 Subject: Re: Nokogiri not read html file in Cent OS 32-bit Niklas Cathor wrote in post #961490: > Can't reproduce your problem. Try this: > > require 'rubygems' > require 'nokogiri' > # make sure the file contains sth. > File.open('test.html', 'w') {|f| > f.write("

Foo

") } > > f = File.open('test.html') > data = Nokogiri::HTML(f) > puts data > p data > > ----- OUTPUT ------ > > "http://www.w3.org/TR/REC-html40/loose.dtd"> >

Foo

> # children=[#, > # children=[# children=[# children=[#]>]>]>]> Hi, First thanks to all for helping me in my problem. I got the solution finally, I tried f = open("test.html").read data = Nokogiri::HTML(f) puts data instead of f = FIle.open("test.html") data = Nokogiri::HTML(f) puts data and i get html data. so basically i don't use File class. Thanks, Priyank Shah -- Posted via http://www.ruby-forum.com/.