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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:57:20+00:00 2026-05-17T15:57:20+00:00

I am using twill and python to write a web crawler. showforms() returns Form

  • 0

I am using twill and python to write a web crawler. showforms() returns

Form name=customRatesForm (#1)
## ## __Name__________________ __Type___ __ID________ __Value__________________
10    originState              hidden    originState  TN 
11    destState                hidden    destState    IL 
12    originZip                text      originZip    37130 
13    destZip                  text      destZip      60602 
16    classes                  select    classes1     ['0000'] of ['0000', '0500', '0550', ... 
17    weight                   text      weight1      600 
18    weight                   text      weight2       
19    weight                   text      weight3       
20    weight                   text      weight4       
30 1  submit                   submi ... submit      

I’ve taken out most of the rows to make it easier to read. My problem is that there are actually 12 selects and all of them have the name ‘classes’. These pass through CGI as a list. However, Twill seems unable to distinguish between them. Also, when I run

fv('1', 'classes', '0500')

I get the following error:

_mechanize_dist.ClientForm.AmbiguityError: id=None name='0500' label=None

I have tried a few workarounds including renaming the selects with their ids and then rewriting the submit function to use a jQuery selector and reassign their ‘name’ attribute back to ‘classes’:

$('.myclasses').attr('name', 'classes');

when I view this in the browser, it seems to reassign them as expected. However, twill’s headers still show it as submitting with the names ‘classes1’, ‘classes2’, etc.

any help would be much appreciated. I’m out of workarounds that I know of. Because this isn’t my page, I am bound by their controller’s expectations of a list for the ‘classes’ selects.

  • 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-17T15:57:20+00:00Added an answer on May 17, 2026 at 3:57 pm

    as far as i’ve found till now, there is no way to do this with twill. any solution is going to be a workaround outside of twill.

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

Sidebar

Related Questions

Using PyObjC , you can use Python to write Cocoa applications for OS X.
I've developed some web-based applications till now using PHP, Python and Java. But some
If I write a python script using only python standard libraries, using Python 2.6
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using JDeveloper , I started developing a set of web pages for a project
I have installed twill on my computer (having previously installed Python 2.5) and have
I am using CakePHP v1.2 for my web application hosted here: http://lol-land.in The application
I'm trying to build a C++ extension for python using swig. I've followed the
I am having trouble in using inheritance with Python. While the concept seems too

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.