您需要在 twill shell 中运行这些命令,而不是 python shell
D:\tmp\twill-0.9>python twill-sh
-= Welcome to twill! =-
current page: *empty page*
>>
看到的时候可以放斜纹命令>>
或者 twill-sh 文件中只有 2 行
import twill.shell
twill.shell.main()
您可以将那 2 行复制粘贴到 python 提示符。
>>> import twill.shell
>>> twill.shell.main()
-= Welcome to twill! =-
current page: *empty page*
>> ?
Undocumented commands:
======================
add_auth fa info save_html title
add_extra_header find load_cookies setglobal url
agent follow notfind setlocal
back formaction redirect_error show
clear_cookies formclear redirect_output show_cookies
clear_extra_headers formfile reload show_extra_headers
code formvalue reset_browser showforms
config fv reset_error showhistory
debug get_browser reset_output showlinks
echo getinput run sleep
exit getpassword runfile submit
extend_with go save_cookies tidy_ok
current page: *empty page*
>>