Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6749495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:41:49+00:00 2026-05-26T12:41:49+00:00

I start using mechanize with Rails, but seems it doesn’t work correctly, it won’t

  • 0

I start using mechanize with Rails, but seems it doesn’t work correctly, it won’t find fields inside form. I’ve tried to use example from Mechanize web site, but it doesn’t work. I did:

agent = Mechanize.new
page = agent.get('http://google.com/')

It returns:

=> #<Mechanize::Page
 {url #<URI::HTTP:0xb340ba74 URL:http://www.google.by/>}
 {meta_refresh}
 {title "Google"}
 {iframes}
 {frames}
 {links
  #<Mechanize::Page::Link
   "Выявы"
   "http://www.google.by/imghp?hl=be&tab=wi">
  #<Mechanize::Page::Link
   "Пераклад"
   "http://translate.google.by/?hl=be&tab=wT">
  #<Mechanize::Page::Link
   "Групы"
   "http://groups.google.by/grphp?hl=be&tab=wg">
  #<Mechanize::Page::Link
   "Гісторыя пошуку"
   "http://www.google.com/history/optout?hl=be">
  #<Mechanize::Page::Link "Наладкі" "/preferences?hl=be">
  #<Mechanize::Page::Link
   "Увайсьці"
   "https://www.google.com/accounts/ServiceLogin?hl=be&continue=http://www.google.by/">
  #<Mechanize::Page::Link
   "Пашыраны пошук"
   "/advanced_search?hl=be">
  #<Mechanize::Page::Link "Language tools" "/language_tools?hl=be">
  #<Mechanize::Page::Link
   "русском"
   "http://www.google.by/setprefs?sig=0_U7jPRU_lW24j6EjPs4nuN1IxPcM=&hl=ru">
  #<Mechanize::Page::Link "Усё пра Google" "/intl/be/about.html">
  #<Mechanize::Page::Link "Google.com in English" "http://www.google.com/ncr">}
 {forms
  #<Mechanize::Form
   {name "f"}
   {method "GET"}
   {action "/search"}
   {fields}
   {radiobuttons}
   {checkboxes}
   {file_uploads}
   {buttons}>}>

page.form('f') returns:

=> #<Mechanize::Form
 {name "f"}
 {method "GET"}
 {action "/search"}
 {fields}
 {radiobuttons}
 {checkboxes}
 {file_uploads}
 {buttons}>

google_form.q = 'ruby mechanize' returns:

NoMethodError: undefined method q=' for #<Mechanize::Form:0xb33e7070>
from /usr/lib/ruby/gems/1.8/gems/mechanize-2.0.1/lib/mechanize/form.rb:162:in
method_missing’
from (irb):23

I use Mechanize version 2.0.1 and Nokogiri version 1.4.4, Ruby 1.8.7 and Rails 3.1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:41:50+00:00Added an answer on May 26, 2026 at 12:41 pm

    Use the hash access variation to set a field:

    google_form['q'] = 'ruby mechanize'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to start using Python for small projects but the fact that a
I am ready to start using SVN, but I have NO (as in the
I'm trying to start using LINQ and specifically LINQ to SQL but I'm having
I want to start using .NET 3.5 features in an app that is currently
I want to start using Nunit (finally), I am using Visual Studio 2008. Is
I would like to start using the WCF Rest Starter Kit's HttpClient to build
I'm about to start using the MS ReportViewer in a WPF application by placing
So I decided to start using prototype and here's my first question. I'm trying
I'm looking to start using a key/value store for some side projects (mostly as
I want to start using memcache with PHP (on Ubuntu 9.10). There are lots

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.