On Mon, Sep 11, 2006 at 09:04:49AM -0400, Mat Schaffer
wrote:> I noticed that my message is the first post to mechanize-
> users at rubyforge.org. Should I post to devel? That looks empty too,
> but I thought I''d check if you were only watching the devel list
and
> not the users list.
Hey Mat, this is definitely a bug in mechanize. If you add this to your
script, it should take care of the problem until I make a bugfix
release:
require ''rubygems''
require ''mechanize''
class Hpricot::Elem
def all_text
text = ''''
children.each do |child|
if child.respond_to? :content
text << child.content
end
if child.respond_to? :all_text
text << child.all_text
end
end
text
end
end
agent = WWW::Mechanize.new
page = agent.get(<URL for test.html>)
p page.links.text(/Dude/)
Sorry about this bug, I should have a bug fix release out on the 20th or
the 21st. I hope this helps.
--Aaron
--
Aaron Patterson
http://tenderlovemaking.com/