[twill] forms

Norman Khine norman at khine.net
Fri May 21 14:37:58 PDT 2010


On Fri, May 21, 2010 at 6:50 PM, Kevin Boers <KBoers at leapfrogonline.com> wrote:
> Hi,
> 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>]

thanks for this, i was not aware of this.

> Hope that helps,

also how would you follow a link, from

showlinks()

based on the ID and not on the 'Name'?

> Kevin
> On May 21, 2010, at 10:54 AM, Norman Khine wrote:
>
> hello,
> 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()
>
> thanks
> --
> %>>> "".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
> http://lists.idyll.org/listinfo/twill
>
> Kevin P. Boers
> QA Manager
> 847-440-8381
>
> Leapfrog Online
> 807 Greenwood
> Evanston, IL  60201
> Main 847-492-1968
> Fax  847-492-1990
> kboers at leapfrogonline.com
> www.leapfrogonline.com
>
> ________________________________
> CONFIDENTIALITY NOTE
> 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.
>
> _______________________________________________
> twill mailing list
> twill at lists.idyll.org
> http://lists.idyll.org/listinfo/twill
>
>



-- 
¿noʎ uɐɔ uʍop ǝpısdn ǝʇıɹʍ uɐɔ ı - %>>> "".join( [
{'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-83)%26) for c in
",adym,*)&uzq^zqf" ] )



More information about the twill mailing list