[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] mechanize 0.8.4 Released

Aaron Patterson

10/3/2008 6:28:00 AM

mechanize version 0.8.4 has been released!

* <http://mechanize.rubyforg...
* <http://github.com/tenderlove/mechanize/tree/...

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.rubyforg...
* <http://github.com/tenderlove/mechanize/tree/...

--
Aaron Patterson
http://tenderlovem...

8 Answers

hemant

10/3/2008 2:42:00 PM

0

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.rubyforg...
> * <http://github.com/tenderlove/mechanize/tree/...
>
> 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

10/3/2008 3:09:00 PM

0

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.rubyforg...
> > * <http://github.com/tenderlove/mechanize/tree/...
> >
> > 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?

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 Patterson
http://tenderlovem...

Mark Gallop

10/17/2008 2:48:00 PM

0

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

Aaron Patterson

10/18/2008 3:30:00 AM

0

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!

Thanks! You're welcome!

--
Aaron Patterson
http://tenderlovem...

Marc Heiler

10/18/2008 7:28:00 PM

0

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

Same here :)

And the documentation + examples are really fine.
--
Posted via http://www.ruby-....

Han Holl

10/21/2008 11:24:00 AM

0

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

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,

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

Aaron Patterson

10/22/2008 6:18:00 AM

0

Hi Han,

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:
>
> > 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/?gro...

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

http://github.com/tenderlove/mechanize/t...


> 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/proj...

And install frex

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

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://tenderlovem...nokogiri-0.0.0.20081021...

Hope that helps!

--
Aaron Patterson
http://tenderlovem...

Han Holl

10/22/2008 9:31:00 AM

0

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

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

>
>
> You can submit it via the mechanize rubyforge tracker here:
>
> http://rubyforge.org/tracker/?gro...


Ok. Did that.

>
>
> Yes. Unfortunately you have to install a couple dependencies. First
> install racc which is available here:
>
> http://i.loveruby.net/en/proj...
>
> And install frex
>
> % sudo gem install aaronp-frex -s http://gems....
>


-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.20081021...
>
> 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.imd...
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