问题
If I run a twill script to download a web page, will the twill script run any javascript (inline or otherwise) on the page? Will it do it correctly?
The official twill site doesn't seem to indicate whether or not twill supports js (which makes me guess that it doesn't)
回答1:
From the twill website:
twill strives to be a complete implementation of a Web browser, omitting only JavaScript support.
(that's the very first sentence in the page I linked above)
So I guess the answer to your question is "no, it doesn't".
If that's a problem for you, have you considered using an automated testing platform which integrates with a full standard browser, such as Selenium?
来源:https://stackoverflow.com/questions/6202446/does-twill-run-javascript-correctly-at-all