开发者

Python WebKitWebView: how to get (generated) source code

Is it possible to get the generated source code (so including JavaScript added DOM nodes) with Python and WebKit, and if so, how?

import webkit
web_vie开发者_开发百科w = webkit.WebView()
web_view.open('http://google.com')

But then?


Bind a function to the loadFinished(bool) signal, in that function you can use mainFrame().toHtml() to get the source code.


I found how to do it here: http://blog.motane.lu/2009/06/18/pywebkitgtk-execute-javascript-from-python/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜