[twill] how to access results from "find"-command

Tim Hatch tim at timhatch.com
Wed Mar 24 16:36:34 PDT 2010

> from twill.commands import go, find, echo
> go("http://somepage")
> find("sometext")
> and now I don't know how to print the results. The manual says about
> find: When called from Python, the matching string is returned.

No firsthand experience, but from digging in the code, you can do:

>>> from twill.namespaces import get_twill_glocals
>>> g, l = get_twill_glocals()
>>> print l['__match__']


More information about the twill mailing list