[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Hpricot parsing problems

-- --

2/3/2009 7:08:00 PM

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-40...))

content = (doc/"posts").text

aFile = File.new("c:\\content.html", "w")
aFile.write(content)
aFile.close
--
Posted via http://www.ruby-....