class Browser(QWebView):

    def __init__(self):
        QWebView.__init__(self)
self.loadFinished.connect(self._result_available)

def _result_available(self, ok):
    frame = self.page().mainFrame()
print(str(frame.toHtml()).encode('utf-8'))
if __name__ == '__main__':
    app = QApplication(sys.argv)
How to display html using QWebView. Python?