[ANN] mechanize 0.8.4 Released

mechanize version 0.8.4 has been released!

* <http://mechanize.rubyforge.org/>
* <http://github.com/tenderlove/mechanize/tree/master>

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

* Bug Fixes:
  * Setting the port number on the host header.
  * Fixing Authorization headers for picky servers

* <http://mechanize.rubyforge.org/>
* <http://github.com/tenderlove/mechanize/tree/master>

···

--
Aaron Patterson
http://tenderlovemaking.com/

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

···

On Fri, Oct 3, 2008 at 11:57 AM, Aaron Patterson <aaron@tenderlovemaking.com> wrote:

mechanize version 0.8.4 has been released!

* <http://mechanize.rubyforge.org/&gt;
* <http://github.com/tenderlove/mechanize/tree/master&gt;

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.

Aaron Patterson wrote:

mechanize version 0.8.4 has been released

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

Cheers,
Mark

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 Holl

···

On Fri, Oct 3, 2008 at 8:27 AM, Aaron Patterson <aaron@tenderlovemaking.com>wrote:

mechanize version 0.8.4 has been released!

Hi Aaron,

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.

···

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

On Fri, Oct 3, 2008 at 11:57 AM, Aaron Patterson > <aaron@tenderlovemaking.com> wrote:
> mechanize version 0.8.4 has been released!
>
> * <http://mechanize.rubyforge.org/&gt;
> * <http://github.com/tenderlove/mechanize/tree/master&gt;
>
> 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.
>

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

--
Aaron Patterson
http://tenderlovemaking.com/

Thanks! You're welcome!

···

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

Aaron Patterson wrote:

mechanize version 0.8.4 has been released

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

--
Aaron Patterson
http://tenderlovemaking.com/

Hi Han,

> 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

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 ?

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 Tue, Oct 21, 2008 at 08:23:44PM +0900, Han Holl wrote:

On Fri, Oct 3, 2008 at 8:27 AM, Aaron Patterson > <aaron@tenderlovemaking.com>wrote:

--
Aaron Patterson
http://tenderlovemaking.com/

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

Same here :slight_smile:

And the documentation + examples are really fine.

···

--
Posted via http://www.ruby-forum.com/\.

You can submit it via the mechanize rubyforge tracker here:

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

Ok. Did that.

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

-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 Holl

···

On Wed, Oct 22, 2008 at 8:18 AM, Aaron Patterson <aaron@tenderlovemaking.com > wrote: