Displaying 20 results from an estimated 2000 matches similar to: "How to delete a node with Hpricot?"
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''
require
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 you have any questions, e-me.
Thanks,
--Dan Bikle
--
You
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(main):003:0> require
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 I''m wrong. Otherwise, I''ll submit a patch in the docs.
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 href=\"http://dolor.com/\">dolor</a>
2007 Jan 12
1
Single method call to retrieve the entire page in HTML?
All,
Another easy question. In Hpricot, on a doc that I am using, I can do a
.to_html method and retrieve the entire page. However, this doesn''t seem to
work in Mechanize.
My goal is to the text of the page and put it into a database to make it
searchable with ferret (using the acts_as_ferret plugin in Rails). Does
anyone have a good suggestion short of iterating over the entire
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@lukeredpath.co.uk
-------------- next part --------------
An HTML
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_s
=>"<p> test world</b></p>"
what I expected is
2007 Mar 15
0
SOLVED: Getting info from an Hpricot::Elem
I knew as soon as I hit the enter key, the intelligence would feed my
brain. The answer to this is:
elements[1]["value"]
Easy Peasy....and why not? (there is 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:
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-installing everything
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 like this:
nth = proc { |num,i| self.position == num.to_i }
What is
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&q=football+manager+2008&searchTitle=on
redirects
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
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 `innerHTML'' for
2009 May 05
3
Only partially reading a page!
I am trying to get a page which includes a form, but the form is
missing from the WWW::Mechanize::Page object. I retrieve it via:
page = web_agent.submit(a_different_form)
For debugging this problem, I then immediately write the resulting
page to two different logs:
File.open(''big.html'',''wb'') { |f| f.write(page.body) }
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 scratching my head
@url1 =
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 group, send email to
2006 Aug 04
0
Hard break broken in 3.0.4?
Is :hard_break working in RedCloth 3.0.4?
$ ruby -v
ruby 1.8.4 (2005-12-24) [i686-linux]
$ pwd
/lib/ruby/gems/1.8/gems/RedCloth-3.0.4/lib
$ irb
irb(main):001:0> require ''redcloth''
=> true
irb(main):002:0> rc = RedCloth.new("h1. Heading\n\n_Not_ heading.")
=> "h1. Heading\n\n_Not_ heading."
irb(main):003:0>
2008 Oct 07
6
Hpricot loop question to read table row values
Hi.
I''ve got a file that contains a table that looks like this:
<table>
<tr><td>column title a</td><td>column title b</td></tr>
<tr><td>row 1 a</td><td>row 1 b</td></tr>
<tr><td>row 2 a</td><td>row 2 b</td></tr>
<tr><td>row 3 a</td><td>row 3
2007 Feb 26
1
some Mechanize objects never garbage collected?
Greetings,
I''m using Mechanize to scrap dozens of pages and have noticed the
size of my ruby process keeps growing. I set Mechanize.max_history to
0 with no effect on the memory use. I wrote a little test to show the
objects left on the heap after mechanizing a single page and then
doing a garbage collection. Sample list appended below. I can supply
the test code if it helps.