Twill是一种简单的Web浏览脚本语言。它碰巧运动一个python api。
twill is essentially a thin shell around the mechanize package. All twill commands are implemented in the commands.py file, and pyparsing does the work of parsing the input and converting it into Python commands (see parse.py). Interactive shell work and readline support is implemented via the cmd module (from the standard Python library).
“压” 的一个例子从上面的链接文档提交:
from twill.commands import go, showforms, formclear, fv, submit
go('http://issola.caltech.edu/~t/qwsgi/qwsgi-demo.cgi/')
go('./widgets')
showforms()
formclear('1')
fv("1", "name", "test")
fv("1", "password", "testpass")
fv("1", "confirm", "yes")
showforms()
submit('0')
由于错误:我需要使用submit()not submit('0'):HiddenControl实例没有属性'_click'。请参阅:lists.idyll.org/pipermail/twill/2006-August/000526.html – user391339 2014-09-11 07:59:58