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