Hpricot parsing problems


#1

Hi,

I would like to get only post content of forum page without any banners
etc.

I made short code to make this. The problem is that Hpricot functions
doesn’t return any content. Page loading works but parsing not and file
is empty.
I’m using Windows Vista and Ruby-186-27.

require ‘rubygems’
require ‘hpricot’
require ‘open-uri’

doc =
Hpricot(open(‘http://forumserver.twoplustwo.com/38/omaha-high/i-can-only-stack-off-nuts-flop-402653/’))

content = (doc/“posts”).text

aFile = File.new(“c:\content.html”, “w”)
aFile.write(content)
aFile.close