Road to Ruby Mechanize 0.6.0

I've been working pretty hard on merging Mechanize with Hpricot in to what I call Mechpricot, or Hprichanize. Things are going quite well.

I've totally cleaned up the Cookie code to use more cookie code from WEBrick, and in the process I found a bug in the way that WEBrick parses set-cookie headers. Unfortunately no one has replied to my patch on ruby-talk, so I think I'll try ruby-core next.....

I removed the dependency on mime-types in favor of using code in WEBrick. I'd like to have as few dependencies as possible. I would like to make a few more performance tweaks before I release. I'll see if I can get this completely done before this weekend. Otherwise everyone will have to wait until I'm back from Spain!

One Comment

  1. Posted September 19, 2006 at 2:37 pm | Permalink

    The new Mechanize is great (and so were the older versions), but I did find a bug in the cookies today after pulling my hair out for 3 hours. I would post this to the developer mailing list, but it seems to be not functioning, or is just very slow. Anyhow…In CookieJar#cookies(url), all of the cookies are retrieved whose domain matches that of the given URL. The problem is that this match is being done in a case-sensitive way, when (obviously) domain names are not case sensitive. I haven’t tested to see if this fix works, but I bet you’ll just need to change the following…
    if url.host =~ /#{domain}$/
    to
    if url.host =~ /#{domain}$/i

    Thanks again for creating this fabulous web scraper!

Post a Comment

Your email is never shared. Required fields are marked *

*
*
Check Spelling
Activate Spell Check while Typing