Why this code does not work ? I want save dom after js execute at this page and i want use qt without gui. Sorry for my English.
#coding:utf-8
from PyQt4 import QtCore, QtWebKit
class Sp():
def save(self):
print "call"
data = self.webView.page().currentFrame().documentElement().toInnerXml()
open("htm","w").write(data)
def main(self):
self.webView = QtWebKit.QWebPage()
self.webView.load(QtCore.QUrl("http://www.google.com"))
QtCore.QObject.connect(self.webView,QtCore.SIGNAL("loadFinished(bool)"),self.save)
s = Sp()
s.main()