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-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Hpricot parsing problems
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password