from PyQt5 import QtCore

from PyQt5.QtWebKitWidgets import QWebView


class MyBrowser(QWebView):
    closing = QtCore.Signal()
    def __init(self):
        super().__init__()
        self.loadFinished.connec(self._results_available)
    def _results_available(self, ok):
        print("results")
        frame = self.page().mainFrame()
        print(unicode(frame.toHtml()).encode('utf-8'))

    def closeEvent(self, event):
        print("done")
        self.closing.emit()



from PyQt5 import QtCore
from PyQt5.QtWebKitWidgets import QWebView


class MyBrowser(QWebView):
    #closing = QtCore.Signal()

    def __init(self):
        super().__init__()
        self.loadFinished.connec(self._results_available)

    def _results_available(self, ok):
        frame = self.page().mainFrame()
        print(unicode(frame.toHtml()).encode('utf-8'))

    def closeEvent(self, event):
        #print("done")
        pass
        #self.closing.emit()



Fix issue with signal on tars
Fix issue with signal on tars

  from PyQt5 import QtCore
- 
  from PyQt5.QtWebKitWidgets import QWebView
  
  
  class MyBrowser(QWebView):
-     closing = QtCore.Signal()
+     #closing = QtCore.Signal()
+ 
      def __init(self):
          super().__init__()
          self.loadFinished.connec(self._results_available)
+ 
      def _results_available(self, ok):
-         print("results")
          frame = self.page().mainFrame()
          print(unicode(frame.toHtml()).encode('utf-8'))
  
      def closeEvent(self, event):
-         print("done")
+         #print("done")
+         pass
-         self.closing.emit()
+         #self.closing.emit()
  
  
  
Fix issue with signal on tars
## Code Before:
from PyQt5 import QtCore

from PyQt5.QtWebKitWidgets import QWebView


class MyBrowser(QWebView):
    closing = QtCore.Signal()
    def __init(self):
        super().__init__()
        self.loadFinished.connec(self._results_available)
    def _results_available(self, ok):
        print("results")
        frame = self.page().mainFrame()
        print(unicode(frame.toHtml()).encode('utf-8'))

    def closeEvent(self, event):
        print("done")
        self.closing.emit()



## Instruction:
Fix issue with signal on tars
## Code After:
from PyQt5 import QtCore
from PyQt5.QtWebKitWidgets import QWebView


class MyBrowser(QWebView):
    #closing = QtCore.Signal()

    def __init(self):
        super().__init__()
        self.loadFinished.connec(self._results_available)

    def _results_available(self, ok):
        frame = self.page().mainFrame()
        print(unicode(frame.toHtml()).encode('utf-8'))

    def closeEvent(self, event):
        #print("done")
        pass
        #self.closing.emit()


