Displaying 20 results from an estimated 144 matches for "hpricot".
2008 Apr 09
5
Peculiar Hpricot error in Rails app
Hi,
I have been stumped by this error Hpricot is generating in my rails
app. The error looks like this:
$ script/console
Loading development environment (Rails 2.0.2)
>> str = ''<p>lorem ipsum <a href="http://dolor.com/">dolor</a> sit amet.</p>''
=> "<p>lorem ipsum <a hr...
2007 Jun 11
3
hpricot as dependency for building rspec?
It looks to me that hpricot is a dependency to building rspec:
euclid% rake pre_commit
(in /Users/smtlaissezfaire/ruby/projects/rspec/hpricot)
rake aborted!
Could not find RubyGem hpricot (>= 0.0.0)
/Users/smtlaissezfaire/ruby/projects/rspec/hpricot/rakefile:9
(See full trace by running task with --trace)
Let me know if...
2011 Apr 18
2
rubygems fail - require hpricot!
Hi guys,
I wanted to fetch some info from webpage and use it in my db. I read
hpricot is one way to do it. But the problem is I''m unable to use it
with my app. For some reason after successfully installing hpricot it
fails when I try to use it in the rails console.
I''ve been trying to fix this for the last four-five days. I''m stumped !
I tried re-installi...
2011 May 25
1
can't load hpricot gem in rails 3
This is in windows ..
So from irb, I can load hpricot ok. (ruby 1.8.7)
C:\Users\Laurence\rails-play\plug-test>irb
irb(main):001:0> require ''hpricot''
LoadError: no such file to load -- hpricot
from (irb):1:in `require''
from (irb):1
irb(main):002:0> require ''rubygems''
=> true
irb(...
2010 Feb 15
5
help on how append html tag
Dear all,
@doc = Hpricot(open("#{RAILS_ROOT}" +
"/public/server_exe/#{list.file_path}"))
i need to add <img src = "/ScreenCapture/#{@file_name}"/> element to my
@doc hpricot instance..
Please help me... how can i add the above img src element to the @doc
hpricot instance..
Thank you
-...
2006 Jul 07
2
Testing views with Hpricot
assert_tag smells bad. Hpricot smells nice (apricotty!).
Testing your views with Hpricot:
http://www.lukeredpath.co.uk/index.php/2006/07/07/testing-your-rails-
views-with-hpricot/
Big thanks to _why for a great little library!
Feedback is appreciated. rSpec integration coming soon (hopefully!).
Cheers,
Luke Redpath
contact@...
2009 Apr 15
0
hpricot bug?
I get an error in the hpricot-gem on Windows XP sp3. I have tested
different versions of it and combined them with different versions of
sequel (including the latest of both).
The error triggers on the line when I do: require ’hpricot’.
The line that causes the error in the hpricot-gem in the file
elements.rb (line 395) looks...
2009 Sep 25
1
how to remove bogusetag by hpricot?
I have use hpricot to translate users'' input html. I want to remove
bogusetag as follows:
>>doc = Hpricot "<p> test world</b></p>", :xhtml_strict => true
=>#<Hpricot::Doc {elem <p> " test world" {bogusetag </b>} </p>}>
>>doc.to_...
2010 Jan 06
0
Built with Rails: http://hpricot.com
People,
I enhanced http://hpricot.com and deployed it to heroku.
I use hpricot.com to build and test various hpricot expressions and
then run them against a variety of websites.
Hpricot.com shows you the resulting html.
Also hpricot.com will render the resulting html.
For some development activities, hpricot.com is useful.
If...
2010 Mar 07
8
Parsing XML file with no style info with Hpricot
Hello,
I''ve been trying for hours to parse an XML using Hpricot. Usually it''s
not a problem. Here''s my simple code:
#This works and outputs the proper xml data
@url1 = ''http://www.sportingnews.com/stories/sportingnews/MLB/rss.xml''
@page1 = Hpricot(open(@url1))
<%= @page 1 %>
#This does not work, and I''m scrat...
2009 Apr 01
2
hpricot won't scrape! (newb question)
Hey all! Just to preface, I am fairly new to RoR, and brand new to
using hpricot.
I am using the following code to scrape this xpath:
"/html/body/div/div[5]/div/div[2]/div[2]/div[2]"
from this url:
"http://www.greatnonprofits.org/"
Here is my code to do so (taken from igvita.com''s related blogpost):
*************
require ''rubygems'...
2007 Mar 15
0
SOLVED: Getting info from an Hpricot::Elem
...a pun there if you can see it)
Thanks for listening.
Mike B.
----- Forwarded message from barjunk at attglobal.net -----
Date: Wed, 14 Mar 2007 17:49:57 -0800
From: barsalou <barjunk at attglobal.net>
Reply-To: barsalou <barjunk at attglobal.net>
Subject: Getting info from an Hpricot::Elem
To: mechanize-users at rubyforge.org
How about getting the name and value from this element object:
irb(main):079:0> elements[1] => {emptyelem <input
name="SNMPTrustedHost" type="hidden" value="1.2.3.4">}
irb(main):080:0> elements[1...
2007 May 21
0
How to delete a node with Hpricot?
Hi,
Sorry if this is not the right forum for this question.
If a node is bad I''m trying to comment it out. If it''s really bad
I''m trynig to delete it.
The way I''m trying to do is is as follows.
def this_is_a_problem
doc = Hpricot( html )
doc.traverse_element do |node|
if some_bad_node_test
unless really_bad?
node.swap( "<!-- comment out node #{node.to_html} -->" )
else
node.swap( "" )
end
end
doc.to_html
end
However I''m getting a nasty error.
TypeError: no...
2008 Nov 27
3
How to parse info from an xml response
Hi all!
In my app I want to detect what country a visitor is viewing from by
their IP.
Although it''s by no means perfect, the simplest option I''ve found is
by using this site:
http://api.hostip.info/
by passing the ip address as a query, this site returns an xml file
with the country as one of the tags.
http://api.hostip.info/?ip=6.255.255.255 returns (amongst other
things)
2007 Oct 24
3
Working with the response DOM
Hi,
Anyone know a way to traverse/query the DOM in a response?
I''m trying to write reusable story step implementations and as much as
possible want to work with the actual response from a previous GET.
As an example, I often have buttons that POST/PUT a hidden value.
My goal is a reusable step implementation that takes the button label and
works the existing response DOM to make an
2007 Nov 14
0
Hpricot & mechanize fail to parse page after redirect1q
Hi everyone,
My quest with mechanize/Hpricot continues :)
Something extremely strange happened today - some simple working code broke
down, and i can''t figure out why.
I am trying to access a piratebay.org search page, which does a redirect to
a relative url like this:
original link:
http://thepiratebay.org/s/?page=0&orderby=3&a...
2007 Mar 15
0
Getting info from an Hpricot::Elem
How about getting the name and value from this element object:
irb(main):079:0> elements[1] => {emptyelem <input
name="SNMPTrustedHost" type="hidden" value="1.2.3.4">}
irb(main):080:0> elements[1].class
=> Hpricot::Elem
If I can do that, then I''m home free. I''ve been looking at the Hpricot
docs, but I''m not seeing what I need.
Should I see the doctor if my vision gets blurred? :)
Mike B.
----------------------------------------------------------------
This message was sent usi...
2007 Jan 04
0
Hpricot
Hi:
Anyone had any luck with parsing Amazon Open Search XML using Hpricot?..
I am having touble with the following types (tags with : and /) of Open
Search XML tags..i.e.
<opensearch:totalresults>81</opensearch:totalresults>
and
<link />http://cnn.com
<br /> abc, xyz etc..
I am getting the following error
link:
parse.rb:8: undefined method `in...
2007 Sep 20
4
issues submitting a search form
Hello to the list and thanks to Aaron for the cool software.
I''ve been fooling around with Mechanize and Hpricot for a couple of
days and from the docs I''ve read, the following code SHOULD work but
doesn''t. I''ve tried the same code on a couple of different sites and I
get the same exception for each. Any pointers or suggestions are
appreciated.
http://pastie.caboo.se/99216
--
Tha...
2011 Jan 06
0
parse.rb:33: [BUG] Segmentation fault ruby 1.8.7 Hpricot
Has anyone had this issue above with hpricot? I cannot seem to find a
solution that works.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this gro...