mechanize version 0.6.7 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:

Mechanize CHANGELOG

0.6.7

  • Fixed a bug with keep-alive requests
  • [#9549] fixed problem with cookie paths

7 Comments

  1. jax
    Posted April 2, 2007 at 6:59 pm | Permalink

    I think you should have less of this tech talk and put more of your poetry on your blog. Really.

  2. Annie
    Posted April 7, 2007 at 4:41 pm | Permalink

    touche.

  3. Posted April 9, 2007 at 10:03 am | Permalink

    When do you think you will update mechanize to work with the latest stable version of Hpricot (0.5.134)? There are a few changes that were made with attributes that is tripping up mechanize 0.6.7.

  4. Posted April 9, 2007 at 10:26 am | Permalink

    Typically I keep mechanize working with gems that _why publishes on Rubyforge. I’ll install the latest from _why’s site and see if I can’t get it working with the next release.

    Is there any specific problem you are seeing? I’d like to make sure I can reproduce the error you’re getting.

  5. Posted April 9, 2007 at 10:42 am | Permalink

    Here’s the exchange from the Hpricot mailing list that talks about the changes to attributes. This is where I’m guess my issue is coming from.

    On Fri, Mar 30, 2007 at 03:16:08AM -0400, Craig Davey wrote:

    or how about:

    doc.at(:a).attributes['href']
    #=> “http://google.com/search?q=hpricot&l=en”

    doc.at(:a).raw_attributes['href']
    #=> “http://google.com/search?q=hpricot&l=en”

    Yes, can do. The real hash will be in rawattributes and

    attributes

    will return an unescaped Hash. So, using

    attributes

    directly isn’t recommended, as it’s slower, use Element#[] or
    Element#getattribute instead.

    Ok ok ok, salutations!!

    _why

    Here’s the error I’m getting when trying to crawl a website
    /usr/local/lib/ruby/gems/1.8/gems/hpricot-0.5.136/lib/hpricot/xchar.rb:89:in

    uxs’: private method

    gsub’ called for nil:NilClass (NoMethodError)
    from /usr/local/lib/ruby/gems/1.8/gems/hpricot-0.5.136/lib/hpricot/tag.rb:58:in

    attributes’
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in

    inject’
    from /usr/local/lib/ruby/gems/1.8/gems/hpricot-0.5.136/lib/hpricot/tag.rb:57:in

    each’
    from /usr/local/lib/ruby/gems/1.8/gems/hpricot-0.5.136/lib/hpricot/tag.rb:57:in

    inject’
    from /usr/local/lib/ruby/gems/1.8/gems/hpricot-0.5.136/lib/hpricot/tag.rb:57:in

    attributes’
    from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.7/lib/mechanize/form_elements.rb:220:in

    initialize’
    from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.7/lib/mechanize/formelements.rb:125:in

    new’
    from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.7/lib/mechanize/form_elements.rb:125:in

    initialize’
    … 31 levels…
    from ./scripts/../grays/book

    adoptions/bookadoptions.rb:15:in
    new’
    from ./scripts/../grays/book_adoptions/book_adoptions.rb:15:in

    get’
    from scripts/get

    adoptions.rb:29:in `getadoptions’
    from scripts/get
    adoptions.rb:51

  6. Posted April 12, 2007 at 8:55 am | Permalink

    I don’t mean to be a bother but I was wondering how the progress is going with updating Mechanize to work with the latest Hpricot gem?

  7. Posted April 13, 2007 at 1:41 pm | Permalink

    Hey Tim. I’m working on in. Unfortunately this is a pretty big change. Also, I seem to have found a bug in the latest hpricot gem. The bug causes my unit tests to fail, but it is a bug with hpricot.

Post a Comment

Your email is never shared. Required fields are marked *

*
*
Check Spelling
Activate Spell Check while Typing