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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:08:17+00:00 2026-05-23T12:08:17+00:00

I am trying to get machine-parsable bus schedule data by submitting a form with

  • 0

I am trying to get machine-parsable bus schedule data by submitting a form with mechanize.

However, I am stymied by the mechanize syntax for setting

import mechanize
br = mechanize.Browser()
br.open("http://www.planibus.sto.ca/HastinfoWeb/StartTimetableForm.aspx")
br.select_form(name="TimetableQueryForm")
br["RouteDirectionDynamicComboBox$ComboBox_Input"] = "10 OTTAWA" # works fine, it's a TextControl
br["DatePicker$DaysDropDownList"] = ["3"] # This is a SelectControl
### mechanize._form.ItemNotFoundError: insufficient items with name '3'

mechanize._form.ItemNotFoundError: insufficient items with name '3' looks like it needs a list, but when I enter more than one item in the list (which makes little sense, given that this is a date picker) I get:

mechanize._form.ItemCountError: single selection list, must set sequence of length 0 or 1

I thought that my original ["3"] was a sequence of length 1?

Thanks for your attention. I’m probably missing something obvious…

Edit: note that the ‘3’ above is just one value, and the web site allows values for the next two weeks in its UI, so depending on when you see this, the list of allowable values will change. Just substitute the ‘3’ with one of the allowable values… Still doesn’t work for me…

  • 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-23T12:08:17+00:00Added an answer on May 23, 2026 at 12:08 pm

    3 isn’t one of the available select options, the options I see are

    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    

    So try br["DatePicker$DaysDropDownList"] = ["4"] and your code should work.

    Edit: I’ve actually tried looking at the page in question with mechanize, try this

    import mechanize
    br = mechanize.Browser()
    br.open("http://www.planibus.sto.ca/HastinfoWeb/StartTimetableForm.aspx")
    br.select_form(name="TimetableQueryForm")
    select = br.form.controls[8] # DatePicker$DaysDropDownList
    select.possible_items()
    >>> []
    

    There aren’t any options, I imagine that javascript is used to populate them after the page has loaded. Unfortunatly mechanize doesn’t support javascript, try using Selenium Webdriver to scrape the data you need.

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

Sidebar

Related Questions

I'm trying to get the IP of the machine a socket I've bound is
I am trying to get a list of shares on a specific machine. So
I'm trying to get my head around AMQP . It looks great for inter-machine
I'm trying to get my head round WF. I'm visualizing a State Machine Workflow
I'm trying to run the get-service command on a remote machine in powershell. After
Im trying to get web2py running on an Ubuntu machine. All the docs seem
I am trying to get IP address on local machine: private string GetIP() {
I'm trying to get boost set up on my machine as I wish to
I'm trying to get Hpricot working with Rails on my dev machine. I've installed
I'm trying to get Subtext 2.1.2 working on my local machine (IIS7). I downloaded

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.