The following code works (and it's very simple):
class Scrape(QApplication):
def __init__(self):
super(Scrape, self).__init__(None)
self.webView = QWebView()
self.webView.loadFinished.connect(self.loadFinished)
def load(self, url):
self.webView.load(QUrl(url))
def loadFinished(self):
documentElement = self.webView.page().currentFrame().documentElement()
myScrape = Scrape()
myScrape.load('http://google.com/ncr')
myScrape.exec_()
but I do not really understand why the exec_() needs to be the last call and if it needs to be then what that load() really does...? How would any of this would work if I would need to load, say, two web pages?