Questions tagged [hpricot]

Hpricot is a Ruby library intended for parsing HTML. Until the release of Nokogiri, a competing HTML and css parser, Hpricot was the defacto HTML parser for the ruby community.

Hpricot is a Ruby library intended for parsing HTML. Until the release of Nokogiri, a competing HTML and css parser, Hpricot was the defacto HTML parser for the ruby community.

163 questions
0
votes
1 answer

ruby noob: /usr/lib/ruby/1.8/rss/rss.rb:922:in `have_required_elements?': undefined method

Sorry, this might be a basic/stupid/noob question - I am just trying to tweak an existing Ruby script - it runs on my Mac ok, but failing to run on Ubuntu 9.04. The error is this: /usr/lib/ruby/1.8/rss/rss.rb:922:in `have_required_elements?':…
Chris Kimpton
  • 5,546
  • 6
  • 45
  • 72
0
votes
1 answer

how to extract onclick in Hpricot ruby

i want to get the parentID from this.
how can i achieve this?
0
votes
1 answer

What is Ruby Hpricot in Nokogiri?

I am trying to change a ruby script to make it more easily portable. Unfortunately hpricot seems a bit complicated to install on MS Windows and I want to avoid it. My ruby skills are however minimal (or less). How do I replace this with…
Leo
  • 4,136
  • 6
  • 48
  • 72
0
votes
1 answer

Why xPath search works in REXML but not with Hpricot?

I am using Rails 3.2 and Hpricot. I’d like to find an XML element by the content of its child element and convert it to a Ruby object, which later shall be rendered. In other words, I’d like to find the ‘vehicle’ element where its child…
BBQ Chef
  • 696
  • 4
  • 11
  • 21
0
votes
1 answer

clean/sanitize HTML, but preserve loses HTML chars with Ruby/Rails + Nokogiri + Sanitize (?)

We were using a combination of the Sanitize gem and HTMLEntities to do some clean up of user input HTML. The Sanitize gem used Hpricot, but now uses Nokogiri. I need to get Hpricot out of the app. Here are two test strings, each followed by the…
whatbird
  • 1,552
  • 1
  • 14
  • 25
0
votes
4 answers

Getting Rails to play with Hpricot

I'm trying to get Hpricot working with Rails on my dev machine. I've installed Hpricot [0.8.1] using the standard 'gem install hpricot' and confirmed it works fine with my standard Ruby installation [1.8.7]; however when I try the same with my Rails…
Justin
  • 4,649
  • 6
  • 33
  • 71
0
votes
1 answer

Get content from div before break

Using hpricot I can get the content of some divs - doc = Hpricot(@response) doc.search(".someDiv").each do |content| puts content.inner_html end //this puts the following cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat…
Finnnn
  • 3,530
  • 6
  • 46
  • 69
0
votes
1 answer

How to append a new node in Hpricot

I have a DOM and I want to insert a new node using Hpricot. Here my DOM structure: ... ... What I want is I have to insert a script tag as a last child of something like: …
Viren
  • 5,812
  • 6
  • 45
  • 98
0
votes
1 answer

Parsing Data in Frames with Mechanize and Ruby

I'm trying to scrape the following website, since the XML is malformed and does not contain all of the data I need: http://www.cafebonappetit.com/menu/your-cafe/pitzer When I fetch the document with Mechanize, however, I only…
AlexSBerman
  • 37
  • 1
  • 5
0
votes
1 answer

Action caching not working

I'm fetching and manipulating XML from twitter and flickr in my rails app. The results appear on every page and the parsing is handled in the Application Controller with Hpricot and open-uri. This is my first experiment with action caching and it…
C. Alan Zoppa
  • 823
  • 8
  • 11
0
votes
2 answers

Ruby: Hpricot Issue - rb_hash_lookup could not be located in msvcrt-ruby18.dll

Update: This issue has been fixed using the RubyInstaller and related DevKit. Please see the answer below. On a new WinXP we are trying to setup RoR. We were having some issue making the rails application run. While debugging Hpricot gem was found…
Saim
  • 2,471
  • 5
  • 30
  • 43
-1
votes
1 answer

Screen scraping through nokogiri or hpricot

I'm trying to get actual value of given xpath. I am having the following code in sample.rb file require 'rubygems' require 'nokogiri' require 'open-uri' doc = Nokogiri::HTML(open('http://www.changebadtogood.com/')) desc "Trying to get the value of…
vinothini
  • 2,606
  • 4
  • 27
  • 42
-2
votes
1 answer

Parsing problem with hpricot

I have an XML that looks like this: What is the correct way to use hpricot to extact just 'http://www.someweb.com/something.png'? The closest I can get is…
Cheryl
  • 1
1 2 3
10
11