Mechanize 0.8.4 Released

mechanize version 0.8.4 has been released!

The Mechanize library is used for automating interaction with websites.
Mechanize automatically stores and sends cookies, follows redirects,
can follow links, and submit forms. Form fields can be populated and
submitted. Mechanize also keeps track of the sites that you have
visited as
a history.

Changes:

0.8.4

On Fri, Oct 3, 2008 at 11:57 AM, Aaron P.
[email protected] wrote:

I saw some of yours posts about running Mechanize on top of
EventMachine. Did it ever work out?

On Fri, Oct 03, 2008 at 11:42:03PM +0900, hemant wrote:

submitted. Mechanize also keeps track of the sites that you have visited as
a history.

I saw some of yours posts about running Mechanize on top of
EventMachine. Did it ever work out?

Not yet. It’s still on my mind, I just haven’t had time to make it
work! Right now I’m focusing on html parsing and javascript support.

Aaron P. wrote:

mechanize version 0.8.4 has been released

I am getting much use out of mechanize. Thanks for your work!

Cheers,
Mark

On Fri, Oct 17, 2008 at 11:48:11PM +0900, Mark G. wrote:

Aaron P. wrote:

mechanize version 0.8.4 has been released

I am getting much use out of mechanize. Thanks for your work!

Thanks! You’re welcome!

I am getting much use out of mechanize. Thanks for your work!

Same here :slight_smile:

And the documentation + examples are really fine.

Hi Han,

On Tue, Oct 21, 2008 at 08:23:44PM +0900, Han H. wrote:

On Fri, Oct 3, 2008 at 8:27 AM, Aaron P.
[email protected]wrote:

mechanize version 0.8.4 has been released!

Hi Aaron,

I’ve got a smallish patch for www/mechanize/chain/response_body_parser.rb.
Where/how can I submit it. Found nothing on either website.

You can submit it via the mechanize rubyforge tracker here:

http://rubyforge.org/tracker/?group_id=1453

Or you can fork my repository and send a pull request at github:

http://github.com/tenderlove/mechanize/tree/master

Any suggestions ?

Yes. Unfortunately you have to install a couple dependencies. First
install racc which is available here:

Racc

And install frex

% sudo gem install aaronp-frex -s http://gems.github.com

I realize that is kind of a pain in the butt, so I’ve posted a
development version of the gem on my internet homesite. Just download
the gem from here:

http://tenderlovemaking.com/nokogiri-0.0.0.20081021110113.gem

Hope that helps!

On Fri, Oct 3, 2008 at 8:27 AM, Aaron P.
[email protected]wrote:

mechanize version 0.8.4 has been released!

Hi Aaron,

I’ve got a smallish patch for
www/mechanize/chain/response_body_parser.rb.
Where/how can I submit it. Found nothing on either website.

And I have some issues with Hpricot, so I would like to try* *nokogiri.
Gem install nokogiri didn’t work. Then got the git repository.
gem build nokogiri.gemspec didn’t work either:
No such file or directory - lib/nokogiri/css/generated_parser.rb

Finally I tried:
gem install nokogiri-0.0.0.20081001111445.gem
ERROR: could not find gem nokogiri-0.0.0.20081001111445.gem locally or
in a
repository

Any suggestions ?

Han H.

On Wed, Oct 22, 2008 at 8:18 AM, Aaron P.
<[email protected]

wrote:

You can submit it via the mechanize rubyforge tracker here:

http://rubyforge.org/tracker/?group_id=1453

Ok. Did that.

-s no longer works with gem. Sould be --source

I realize that is kind of a pain in the butt, so I’ve posted a
development version of the gem on my internet homesite. Just download
the gem from here:

http://tenderlovemaking.com/nokogiri-0.0.0.20081021110113.gem

gem install nokogiri-0.0.0.20081021110113.gem
produced:
No definition for owned_eh
(twice)

Unfortunately, it doesn’t work at all. And even more unfortunately, it’s
not
easy for me to debug, because while ‘pp page.parser’ in the Hpricot case
gives a detailed result from the parsing process, it just gives:
#<Nokogiri::HTML::Document:0x7f06c01d3260
@decorators={“node”=>[], “nodeset”=>[]}>
in the nokogiri version.

I have distilled a small example, without too many dependencies:
#!/usr/bin/ruby -w

require ‘rubygems’
if ENV[‘NOKOGIRI’]
require ‘nokogiri’
end
require ‘mechanize’

if ENV[‘NOKOGIRI’]
WWW::Mechanize.html_parser = Nokogiri::HTML
end

class ImdbScraper
def initialize
@agent = WWW::Mechanize.new { |agent|
agent.user_agent_alias = ‘Linux Mozilla’
}
@baseurl = ‘http://www.imdb.com
page = @agent.get(@baseurl)
@search = page.form(‘find’)
end
def search(lookfor, year = nil)
@search.q = lookfor
page = @agent.submit(@search)
end
end
s = ImdbScraper.new
page = s.search(‘The Catered Affair’, ‘1956’)
puts page.at(‘//div.info’)

end-of-program

Run with and without the NOKOGIRI environment variable set, and see the
difference.
Maybe I’m missing something else that is silently ignored ?

Cheers,

Han H.