Pythonプログラムのtwillモジュールで動作するいくつかのコードn openshfiftがあるので、twillをインストールしましたが、sshモード経由で単純なtwillコマンドを実行できません。コードは次のとおりです。
import twill, os
#os.environ['http_proxy']='http://222.66.115.233:80'
t_com = twill.commands
## get the default browser
t_brw = t_com.get_browser()
## open the url
url = 'http://ieeexplore.ieee.org/xpl/articleDetails'
t_brw.go(url)
html = t_brw.result.page
print html
エラーは次のとおりです ( AttributeError: 'ResultWrapper' オブジェクトに属性 'page' がありません):
>>> import twill, os
os.environ['http_proxy']='http://222.66.115.233:80'
t_com = twill.commands
## get the default browser
t_brw = t_com.get_browser()
## open the url
url = 'http://ieeexplore.ieee.org/xpl/articleDetails'
url= 'www.google.com'
t_brw.go(url)
html = t_brw.result.page
print html
>>> #os.environ['http_proxy']='http://222.66.115.233:80'
... t_com = twill.commands
>>>
>>> ## get the default browser
... t_brw = t_com.get_browser()
>>> ## open the url
>>> url= 'www.google.com'
>>> t_brw.go(url)
==> at http://www.google.com/
>>> html = t_brw.result.page
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'ResultWrapper' object has no attribute 'page'
>>> print html
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'html' is not defined
>>>
それで、これを解決する方法を知っている体はありますか?