I know this is working on other form/selectlist I’ve tried. This particular one doesn’t appear to be ajax. Can anyone shed light on this?
# encoding: UTF-8
require 'rubygems'
require 'mechanize'
require 'open-uri'
agent = Mechanize.new
page = agent.get('http://espn.go.com/nba/team/transactions/_/name/bos/boston-celtics')
form = page.form_with(:class => "js-goto")
fields = form.field_with(:class => "tablesm")
puts fields
It should be returning something like #<Mechanize::Form::SelectList:0x007ffdd3930138>
That selectlist doesn’t have a name attribute, which makes it useless as a form field.
You can still get the data you need to navigate nokogiri style: