# Hpricot parsing problems

**URL:** <https://www.ruby-forum.com/t/hpricot-parsing-problems/159358>\
**Category:** Ruby\
**Created:** [February 3, 2009, 8:08pm UTC](https://www.ruby-forum.com/t/hpricot-parsing-problems/159358 "2009-02-03T20:08:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nfwt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2bfe46/32.png) [@nfwt](https://www.ruby-forum.com/u/nfwt)\
**Post date:** [February 3, 2009, 8:08pm UTC](https://www.ruby-forum.com/t/hpricot-parsing-problems/159358/1 "2009-02-03T20:08:39Z")

</div>

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/](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
