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

  • SEARCH
  • Home
  • 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 7614085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:18:48+00:00 2026-05-31T02:18:48+00:00

I have been working on a Ruby Script that enters in data into a

  • 0

I have been working on a Ruby Script that enters in data into a search field and then needs to click on the enter button. By looking at the “pp” my data is correctly inputing into the search field. The problem I am having is clicking on the “enter” button. What is happening is that it is not moving forward it is just refreshing the current screen. When I manually access the website in question via IE, enter the search data and hit enter on my keyboard it doesn’t roll to the search screen; I have to click with the mouse on enter to get it to move forward. If I use Chrome and preform the same task with the keyboard enter then it opens a new tab. How do I get this programmatically to move forward?

Here is my code:

require 'rubygems'
require 'mechanize'

agent = Mechanize.new
agent.verify_mode = OpenSSL::SSL::VERIFY_NONE
page = agent.get('https://somewebsite.com')

check_form = page.form
check_form['ct100$MainContent$txtNumber'] = 'J520518'

pp page

page = agent.submit(check_form, check_form.buttons.first)

pp page

page.links.each do |link|
  puts link.text
end

Here is snippit from the output:

...
<forms
#<Mechanize::Form
<name nil>
<method "POST">
<action "">
<fields
...
[field:0xb627a0 type: name:ct100$MainContent$txtNumber value: J520518]>
...
<buttons
[submit:0xb6d8ac type: submit name: ct100$MainContent$btnEnter value: Enter]
}>}>
...
<forms
#<Mechanize::Form
<name nil>
<method "POST">
<action "">
<fields
...
[field:0xb627a0 type: name:ct100$MainContent$txtNumber value: ]>
...
<buttons
[submit:0xb6d8ac type: submit name: ct100$MainContent$btnEnter value: Enter]

As always, thank you so much for all your help!

  • 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-31T02:18:49+00:00Added an answer on May 31, 2026 at 2:18 am

    Ok I was able to parse using watir since I am using IE. Then I was able to use nokogiri to parse the last page. Ultimately, I was on the right track with the code above, but Mechanize is not able to handle JavaScript at this time. Since watir is a driver for the brower rather than acting like it’s own browser it is able to handle the JavaScript. I hope this helps anyone that lands on this question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with a Ruby project for school, and have sadly not been able
I have been working with a string[] array in C# that gets returned from
I have been working on some legacy C++ code that uses variable length structures
I'm new to Ruby, and have been working my way through Mr Neighborly's Humble
I have been working with Ruby on Rails for over a year now and
I have been working and tinkering with Nokogiri, REXML & Ruby for a month.
I have been working on my Ruby. When trying to execute this simple example
I happen to be working in a sandboxed Ruby environment and have been trying
I have just been informed that a Rails 3 project I've been working on
I am an experienced PHP programmer, but I have been looking into Ruby lately,

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.