[twill] forms

Kevin Boers KBoers at leapfrogonline.com
Fri May 21 09:50:48 PDT 2010


It's trivial to get at the mechanize ClientForm instances. You might try:

forms = list(twill.showforms())

That would return (e.g., on a site of ours with 2 forms):

[<_mechanize_dist.ClientForm.HTMLForm instance at 0x1010c0cb0>, <_mechanize_dist.ClientForm.HTMLForm instance at 0x1010c0f38>]

Hope that helps,

On May 21, 2010, at 10:54 AM, Norman Khine wrote:

is there a direct way to check how many forms the page returned has?
from the docs:
showforms -- show all of the forms on the current page. When called
from Python, this function returns a list of the forms.

but if i do
b = twill.get_browser()
forms = b.showforms()
print len(forms)

i get
TypeError: object of type 'NoneType' has no len()

%>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or
chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )

twill mailing list
twill at lists.idyll.org<mailto:twill at lists.idyll.org>

Kevin P. Boers
QA Manager

Leapfrog Online
807 Greenwood
Evanston, IL  60201
Main 847-492-1968
Fax  847-492-1990
kboers at leapfrogonline.com<x-msg://107/kboers@leapfrogonline.com>

The document(s) accompanying this e-mail transmission, if any, and the e-mail transmittal message containing information from Leapfrog Online Customer Acquisition, LLC is confidential or privileged. The information is intended to be for the use of the individual(s) or entity(ies) named on this e-mail transmission message. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this e-mail is prohibited. If you have received this e-mail in error, please immediately delete this e-mail and notify us by telephone of the error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/twill/attachments/20100521/2cc94e03/attachment.html>

More information about the twill mailing list