ClientForm checkbox problem.

Francisco Borges frandebo at
Tue Mar 18 12:07:39 CET 2003

Hello all,

I'm trying to use ClientForm to check these checkboxes, click and get
the resulting html. The problem is that I can't properly assign values
to the checkboxes.

The html code looks like this:
<td align=middle><input type=checkbox name=VB value="04000003627219"> </td>
<td align=middle><input type=checkbox name=VB value="04000015305150"> </td>
I get the o

>>> response2 = urllib2.urlopen(request2)
>>> forms = ClientForm.ParseResponse(response2)
>>> form = forms[0]
>>> print form.controls
[<ClientForm.TextControl instance at 0x402c1f8c>, <ClientForm.SubmitControl instance at 0x402c1fac>, <ClientForm.CheckboxControl instance at 0x402c1a8c>, <ClientForm.CheckboxControl instance at 0x402ea08c>]
>>> form['VB'] = ['04000003627219', '04000015305150'] # I would expect this to work.
>>> print form[3]
<CheckboxControl(checkbox, VB=[*04000003627219, *04000015305150])>
>>> print form[3]._value, form.value # But it doesn't...
None []

How do I assign values for a checkbox?? If I try to assign a wrong
value it will rightfully refuse it and raise something. But assigning
the right values will give me nothing. The html I get in response is
the one I should get had I checked none of the checkboxes.

I must be missing something obvious here...

thank you for your attention,
   São Paulo, Brasil.

More information about the Python-list mailing list