2014-12-04 39 views

回答

0
import twill 
import webbrowser 

b = twill.get_browser() 
b.go("https://accounts.coursera.org/") 
page = b.result.get_page() 
tmp_page = "tmp.html" 
with file(tmp_page, "w") as f: 
    f.write(page) 
webbrowser.open(tmp_page) 

# b.showforms() 

我得到一个网页,上面写着..

请使用JavaScript的现代浏览器能够使用Coursera。

所以我怀疑斜纹不包括JavaScript解释器?

+0

是的,看起来像斜纹没有JavaScript支持 http://stackoverflow.com/questions/6202446/does-twill-run-javascript-correctly-at-all – 2014-12-05 01:04:38

+0

耻辱我越来越兴奋斜纹。在python中有一些javascript实现http://stackoverflow.com/questions/7451619/is-there-a-javascript-ecmascript-implementation-written-in-python其中一个可能很容易添加。 – 2014-12-05 01:06:45

+0

ohhh我对这个Twill感到兴奋......我会回去请求-_- – 2014-12-05 07:59:56