[twill] Converting interactive session to code

Jesse London jesselondon at gmail.com
Fri Feb 5 10:30:29 PST 2010


Hi Jamal,

I was able to reproduce your example without a TwillAssertionError, using
twill version 0.9.  I'm not sure what the problem is.  Which version of
Twill are you using?

Jesse

On Fri, Feb 5, 2010 at 11:09 AM, Jamal Mazrui <Jamal.Mazrui at fcc.gov> wrote:

> I'm trying to automate a Wikipedia search using Google to find the best
> matching article.  I have things working in an interactive session with
> the twill shell, but for some reason, the code is not finding the Google
> search form -- I get the error "twill.errors.TwillAssertionError: no
> matching forms!"
>
> Here is the relevant code:
>
> sQuery = 'Python'
> sAddress = 'http://google.com'
> oBrowser = twill.get_browser()
> oBrowser.go(sAddress)
> twill.commands.formvalue(1, 'q', 'site:wikipedia.org ' + sQuery
> twill.commands.submit()
> twill.commands.follow('en.wikipedia.org')
>
>
> Jamal
>
>
> _______________________________________________
> twill mailing list
> twill at lists.idyll.org
> http://lists.idyll.org/listinfo/twill
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/twill/attachments/20100205/7c44184b/attachment.htm>


More information about the twill mailing list