[ANN] mechanize 0.8.4 Released

  • Thread starter Aaron Patterson
  • Start date
A

Aaron Patterson

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

hemant

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.

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

Aaron Patterson

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.
 
M

Marc Heiler

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

Same here :)

And the documentation + examples are really fine.
 
H

Han Holl

[Note: parts of this message were removed to make it a legal post.]

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

Aaron Patterson

Hi Han,

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:

http://i.loveruby.net/en/projects/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!
 
H

Han Holl

[Note: parts of this message were removed to make it a legal post.]

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:

http://i.loveruby.net/en/projects/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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,177
Latest member
OrderGlucea
Top