From: Edouard Dantes Date: 2009-01-21T13:46:58+09:00 Subject: mechanize & field name for search passed as string Hi, I am writing a method to perform a similar to the below mentionned google search but i want it to accept the field's name for the search entry as a string. In the following example from the Mechanize docs I would expect it to be search.send('q') instead of search.q but I get this error ./scrapingGoogle.rb:14: syntax error, unexpected '=', expecting kEND search.send('q') = 'Hello world'. Thanks for your comments ******************************************************************** a = WWW::Mechanize.new { |agent| agent.user_agent_alias = 'Mac Safari' } a.get('http://google.com/') do |page| search_result = page.form_with(:name => 'f') do |search| search.q = 'Hello world' end.submit search_result.links.each do |link| puts link.text end end -- Posted via http://www.ruby-forum.com/.