Forum: Ruby Hpricot parsing problems

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
-- -. (Guest)
on 2009-02-03 21:08
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-...))

content = (doc/"posts").text

aFile = File.new("c:\\content.html", "w")
aFile.write(content)
aFile.close
This topic is locked and can not be replied to.