From: Lex Williams Date: 2008-09-07T17:34:17+09:00 Subject: Re: find a button using mechanize Li Chen wrote: > Hi all, > > I wonder how I find a button in a page(buttons > #}) > with mechanize. > > Thanks, > > Li Well , you should iterate through the fields of each form : my_form = nil catch(:FoundForm) do agent.page.forms.each do |form| form.fields.each do |field| if(field.value == "Go") my_form = form throw FoundForm end end end end and now you would have the form containing the button , and could operate on it. -- Posted via http://www.ruby-forum.com/.