Mechanize - 0.6.3 (Big Man)

Mechanize version 0.6.3 (Big Man) is now available.

= Description
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.

= Example

This searches google for “Ruby” and prints the results

require ‘rubygems’
require ‘mechanize’

agent = WWW::Mechanize.new

agent.get(“http://www.google.com/").form("f”) { |f|
f.q = “Ruby”
}.submit.search("//a[@class=‘l’]").each { |l| puts l.all_text }

= Release Notes

Mechanize 0.6.3 (Big Man) has a few bug fixes and some new features
added to
the Form class. The Form class is now more hash like. I’ve added an
Form#add_field! method that will add a field to your form. Form#[]=
will now
add a field if the key doesn’t exist. For example, your form doesn’t
have
an input field named ‘foo’, the following 2 lines of code are
equivalent, and
will create a field named ‘foo’:
form[‘foo’] = ‘bar’
or
form.add_field!(‘foo’, ‘bar’)
To make forms more hashlike, has_value?, and has_key? methods.

= CHANGELOG

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs