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 8684349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:17:03+00:00 2026-06-12T22:17:03+00:00

Need help I am scraping data from this website which has a form that

  • 0

Need help

I am scraping data from this website which has a form that contains three selectlists interconnected to each other that is if the any option from the from the first select list is selected this function is called onchange="Javascript:submitForm2(); and the second selectlist is populated.

And subsequently if an option from the second selectlist is selected the same js function is called onchange="Javascript:submitForm2();" And finally two submit buttons for this form each call different js function which populate the result. So I checked out the docs and I did not find any info about selectlists.

Three dynamically changing select lists interconnected to each other

<select name="s1" onChange="Javascript:submitForm2();" style="width: 150px" width="150">
<select name="s2" onChange="Javascript:submitForm2();" style="width: 300px" width="300">
<select name="s3" style="width:300px" width="300">

And the form has two submit buttons

Tried with these codes this.click('select#s1 option[value="26"]'); this.debugHTML();

Gives me this error CasperError: Cannot dispatch click event on nonexistent selector: select#s1 option[value="26"]

I also tried document.querySelector('select[name="s1"]').setAttribute('value', "26");
Which gives TypeError: 'null' is not an object (evaluating'document.querySelector('select[name="s1"]').setAttribute')

  • 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-06-12T22:17:04+00:00Added an answer on June 12, 2026 at 10:17 pm

    Sharing the solution script.
    I Iterated upon the select lists n*n*n times along with dates and two buttons.

    
        require 'rubygems'
        require 'capybara-webkit'
        require 'capybara/dsl'
        require 'nokogiri'
    
        include Capybara::DSL
        Capybara.current_driver = :webkit
    
        visit("http://thewebsite.com")
    
        op0_xpath = "//*[@name='selectlist0']/option[1]"
        op0 = find(:xpath, op0_xpath).text
        select(op0, :from => 'selectlist0')
    
        page.evaluate_script("$('body').submitForm2()")
        sleep(2)
    
        op1_xpath = "//*[@name='selectlist1']/option[1]"
        op1 = find(:xpath, op1_xpath).text
        select(op1, :from => 'selectlist1')
    
        page.evaluate_script("$('body').submitForm2()")
        sleep(2)
    
        op2_xpath = "//*[@name='selectlist2']/option[1]"
        op2 = find(:xpath, op2_xpath).text
        select(op2, :from => 'selectlist2')
    
        sleep(2)
    
        find(:xpath, "//input[@name='curYear']").set "2012"
        find(:xpath, "//input[@name='curMonth']").set "10"
        find(:xpath, "//input[@name='curDay']").set "09"
    
        click_button('button1')
        page.evaluate_script("$('body').submitForm()")
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need help writing a script downloads data from google insight using c# this is
Need help with a query that I wrote: I have three tables Company id
I need to store some data that looks a little like this: xyz 123
Need help with this please. I need to save some data in session to
Need help pretty soon on this..... I have a Gridview in which the columns
Need Help to Remove this Part .php?number= from Link with / using .htaccess Old
Need help for implementing PUSH notification in android. wanted to know from which android
Need help getting Ember-Data working with Zend Rest. At first, I'm familiar with Zend
need help regarding USSD Gateway. I have to develop an app, which will directly
I need help with one ajax function This is raw page setup. Page will

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.