From: Jan Svitok Date: 2007-01-13T23:38:54+09:00 Subject: Re: WWW::Mechanize problem On 1/13/07, Peter Szinek wrote: > Hello, > > I could not yet figure out how to work around this problem: > > agent = WWW::Mechanize.new > page = agent.get("http://www.amazon.com/") > search_form = page.forms.with.name("site-search").first > search_form.field-keywords = "Ruby" > > i.e. that the name of the input field is 'field-keywords', so Ruby > thinks (rightfully of course) that I am calling the method 'field' of > the object search_form and of course then the whole thing does not work. > Any suggestions? guessing from http://mechanize.rubyforge.org/classes/WWW/Mechanize/Form.html: search_form['field-keywords'] = "Ruby" or you could do search_form.send(:'field-keywords=', "Ruby")